From 3fb3ba8153e172f4c915745fff32658243b1d354 Mon Sep 17 00:00:00 2001 From: zce Date: Sun, 7 Dec 2025 13:56:48 +0800 Subject: [PATCH 01/48] feat: next demo --- package.json | 3 +- pnpm-lock.yaml | 8 + src/build.ts | 34 +- src/schemas/excerpt.ts | 8 +- src/schemas/file.ts | 10 +- src/schemas/image.ts | 10 +- src/schemas/index.ts | 6 +- src/schemas/isodate.ts | 2 +- src/schemas/markdown.ts | 14 +- src/schemas/mdx.ts | 14 +- src/schemas/metadata.ts | 8 +- src/schemas/path.ts | 8 +- src/schemas/raw.ts | 6 +- src/schemas/slug.ts | 10 +- src/schemas/toc.ts | 14 +- src/schemas/unique.ts | 10 +- src/schemas/zod/ZodError.ts | 327 -- src/schemas/zod/errors.ts | 14 - src/schemas/zod/external.ts | 6 - src/schemas/zod/helpers/enumUtil.ts | 11 - src/schemas/zod/helpers/errorUtil.ts | 5 - src/schemas/zod/helpers/parseUtil.ts | 174 - src/schemas/zod/helpers/partialUtil.ts | 63 - src/schemas/zod/helpers/typeAliases.ts | 2 - src/schemas/zod/helpers/util.ts | 197 - src/schemas/zod/index.ts | 4 - src/schemas/zod/locales/en.ts | 104 - src/schemas/zod/types.ts | 4847 ------------------------ src/zod.ts | 70 + 29 files changed, 148 insertions(+), 5841 deletions(-) delete mode 100644 src/schemas/zod/ZodError.ts delete mode 100644 src/schemas/zod/errors.ts delete mode 100644 src/schemas/zod/external.ts delete mode 100644 src/schemas/zod/helpers/enumUtil.ts delete mode 100644 src/schemas/zod/helpers/errorUtil.ts delete mode 100644 src/schemas/zod/helpers/parseUtil.ts delete mode 100644 src/schemas/zod/helpers/partialUtil.ts delete mode 100644 src/schemas/zod/helpers/typeAliases.ts delete mode 100644 src/schemas/zod/helpers/util.ts delete mode 100644 src/schemas/zod/index.ts delete mode 100644 src/schemas/zod/locales/en.ts delete mode 100644 src/schemas/zod/types.ts create mode 100644 src/zod.ts diff --git a/package.json b/package.json index 740bbde1..4c649334 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,8 @@ "@mdx-js/mdx": "^3.1.1", "esbuild": "^0.25.12", "sharp": "^0.34.5", - "terser": "^5.44.1" + "terser": "^5.44.1", + "zod": "^4.1.13" }, "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "^4.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c84e0221..a32de1bd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: terser: specifier: ^5.44.1 version: 5.44.1 + zod: + specifier: ^4.1.13 + version: 4.1.13 devDependencies: '@ianvs/prettier-plugin-sort-imports': specifier: ^4.7.0 @@ -3549,6 +3552,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zod@4.1.13: + resolution: {integrity: sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -7135,4 +7141,6 @@ snapshots: yocto-queue@0.1.0: {} + zod@4.1.13: {} + zwitch@2.0.4: {} diff --git a/src/build.ts b/src/build.ts index 7b5b6c7e..70fc7700 100644 --- a/src/build.ts +++ b/src/build.ts @@ -8,11 +8,11 @@ import { resolveConfig } from './config' import { VeliteFile } from './file' import { logger } from './logger' import { outputAssets, outputData, outputEntry } from './output' -import { getParsedType, ParseContext } from './schemas/zod' import { matchPatterns } from './utils' +import { parseWithFile } from './zod' import type { LogLevel } from './logger' -import type { Schema, ZodMeta } from './schemas' +import type { Schema } from './schemas' import type { Config } from './types' // cache resolved result for rebuild @@ -43,34 +43,18 @@ const load = async (config: Config, path: string, schema: Schema, changed?: stri const parsed = await Promise.all( list.map(async (data, index) => { // push index in path if file is array - const path = isArr ? [index] : [] - - const ctx: ParseContext = { - common: { issues: [], async: true }, - path, - meta: file as ZodMeta, - data, - parent: null, - parsedType: getParsedType(data), - schemaErrorMap: schema._def.errorMap - } - - // parse data with given schema - const ret = schema._parse({ data, path, meta: ctx.meta, parent: ctx }) + const pathPrefix = isArr ? [index] : [] - const result = await (ret instanceof Promise ? ret : Promise.resolve(ret)) + const result = await parseWithFile(schema, data, file) - if (result.status === 'valid') return result.value + if (result.success) return result.data // report error if parsing failed - ctx.common.issues.forEach(issue => { - const source = issue.path.map(i => (typeof i === 'number' ? `[${i}]` : i)).join('.') - const message = file.message(issue.message, { source }) - message.fatal = result.status === 'aborted' || issue.fatal + result.error.issues.forEach(issue => { + const source = [...pathPrefix, ...(issue.path ?? [])].map(p => (typeof p === 'number' ? `[${p}]` : String(p))).join('.') + const message = file.message(issue.message ?? 'Validation error', { source }) + message.fatal = (issue as any).fatal || file.config.strict === true }) - - // return parsed data unless fatal error - return result.status !== 'aborted' && result.value }) ) diff --git a/src/schemas/excerpt.ts b/src/schemas/excerpt.ts index a37f4b34..3eeb19d6 100644 --- a/src/schemas/excerpt.ts +++ b/src/schemas/excerpt.ts @@ -1,4 +1,4 @@ -import { custom } from './zod' +import { custom } from '../zod' export interface ExcerptOptions { // /** @@ -16,10 +16,10 @@ export interface ExcerptOptions { } export const excerpt = ({ length = 260 }: ExcerptOptions = {}) => - custom(i => i === undefined || typeof i === 'string').transform(async (value, { meta, addIssue }) => { - value = value ?? meta.plain + custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { + value = value ?? ctx.file.plain if (value == null || value.length === 0) { - addIssue({ code: 'custom', message: 'The content is empty' }) + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' } diff --git a/src/schemas/file.ts b/src/schemas/file.ts index 4e2405e5..c1db41c0 100644 --- a/src/schemas/file.ts +++ b/src/schemas/file.ts @@ -1,5 +1,5 @@ import { isRelativePath, processAsset } from '../assets' -import { string } from './zod' +import { string } from '../zod' export interface FileOptions { /** @@ -13,14 +13,14 @@ export interface FileOptions { * A file path relative to this file. */ export const file = ({ allowNonRelativePath = true }: FileOptions = {}) => - string().transform(async (value, { meta, addIssue }) => { + string().transform(async (value, ctx) => { try { if (allowNonRelativePath && !isRelativePath(value)) return value - const { output } = meta.config - return await processAsset(value, meta.path, output.name, output.base) + const { output } = ctx.file.config + return await processAsset(value, ctx.file.path, output.name, output.base) } catch (err) { const message = err instanceof Error ? err.message : String(err) - addIssue({ fatal: true, code: 'custom', message }) + ctx.addIssue({ fatal: true, code: 'custom', message, continue: false }) return null as never } }) diff --git a/src/schemas/image.ts b/src/schemas/image.ts index be17b396..c8c43578 100644 --- a/src/schemas/image.ts +++ b/src/schemas/image.ts @@ -2,7 +2,7 @@ import { readFile } from 'node:fs/promises' import { join } from 'node:path' import { getImageMetadata, processAsset } from '../assets' -import { string } from './zod' +import { string } from '../zod' import type { Image } from '../assets' @@ -23,7 +23,7 @@ export interface ImageOptions { * Image schema */ export const image = ({ absoluteRoot }: ImageOptions = {}) => - string().transform(async (value, { meta, addIssue }) => { + string().transform(async (value, ctx) => { try { if (absoluteRoot && /^\//.test(value)) { const buffer = await readFile(join(absoluteRoot, value)) @@ -42,12 +42,12 @@ export const image = ({ absoluteRoot }: ImageOptions = {}) => // return { src: value, ...metadata } // } - const { output } = meta.config + const { output } = ctx.file.config // process asset as relative path - return await processAsset(value, meta.path, output.name, output.base, true) + return await processAsset(value, ctx.file.path, output.name, output.base, true) } catch (err) { const message = err instanceof Error ? err.message : String(err) - addIssue({ fatal: true, code: 'custom', message }) + ctx.addIssue({ fatal: true, code: 'custom', message }) return null as never } }) diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 79b20c00..46027a54 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,3 +1,4 @@ +import * as z from '../zod' import { excerpt } from './excerpt' import { file } from './file' import { image } from './image' @@ -10,7 +11,6 @@ import { raw } from './raw' import { slug } from './slug' import { toc } from './toc' import { unique } from './unique' -import * as z from './zod' export const s = { ...z, @@ -28,6 +28,4 @@ export const s = { toc } -export { z } // keep z for backward compatibility - -export type { Schema, ZodType, ZodMeta, infer } from './zod' +export type { infer, Schema, ZodType } from '../zod' diff --git a/src/schemas/isodate.ts b/src/schemas/isodate.ts index 3ed59901..86b2b156 100644 --- a/src/schemas/isodate.ts +++ b/src/schemas/isodate.ts @@ -1,4 +1,4 @@ -import { string } from './zod' +import { string } from '../zod' export const isodate = () => string() diff --git a/src/schemas/markdown.ts b/src/schemas/markdown.ts index b0c57942..7869b934 100644 --- a/src/schemas/markdown.ts +++ b/src/schemas/markdown.ts @@ -7,7 +7,7 @@ import { unified } from 'unified' import { visit } from 'unist-util-visit' import { rehypeCopyLinkedFiles } from '../assets' -import { custom } from './zod' +import { custom } from '../zod' import type { Root as Hast } from 'hast' import type { Root as Mdast } from 'mdast' @@ -39,14 +39,14 @@ const rehypeMetaString = () => (tree: Hast) => { } export const markdown = (options: MarkdownOptions = {}) => - custom(i => i === undefined || typeof i === 'string').transform(async (value, { meta, addIssue }) => { - value = value ?? meta.content + custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { + value = value ?? ctx.file.content if (value == null || value.length === 0) { - addIssue({ code: 'custom', message: 'The content is empty' }) + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' } - const { markdown, output } = meta.config + const { markdown, output } = ctx.file.config const enableGfm = options.gfm ?? markdown?.gfm ?? true const removeComments = options.removeComments ?? markdown?.removeComments ?? true @@ -72,10 +72,10 @@ export const markdown = (options: MarkdownOptions = {}) => .use(rehypeRaw) // turn markdown syntax tree to html syntax tree, with raw html support .use(rehypePlugins) // apply rehype plugins .use(rehypeStringify) // serialize html syntax tree - .process({ value, path: meta.path }) + .process({ value, path: ctx.file.path }) return html.toString() } catch (err: any) { - addIssue({ fatal: true, code: 'custom', message: err.message }) + ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) return null as never } }) diff --git a/src/schemas/mdx.ts b/src/schemas/mdx.ts index 41e14f2d..199efb4f 100644 --- a/src/schemas/mdx.ts +++ b/src/schemas/mdx.ts @@ -2,7 +2,7 @@ import remarkGfm from 'remark-gfm' import { visit } from 'unist-util-visit' import { remarkCopyLinkedFiles } from '../assets' -import { custom } from './zod' +import { custom } from '../zod' import type { Root } from 'mdast' import type { PluggableList } from 'unified' @@ -18,14 +18,14 @@ const remarkRemoveComments = () => (tree: Root) => { } export const mdx = (options: MdxOptions = {}) => - custom(i => i === undefined || typeof i === 'string').transform(async (value, { meta, addIssue }) => { - value = value ?? meta.content + custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { + value = value ?? ctx.file.content if (value == null || value.length === 0) { - addIssue({ code: 'custom', message: 'The content is empty' }) + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' } - const { mdx, output } = meta.config + const { mdx, output } = ctx.file.config const enableGfm = options.gfm ?? mdx?.gfm ?? true const enableMinify = options.minify ?? mdx?.minify ?? true @@ -49,7 +49,7 @@ export const mdx = (options: MdxOptions = {}) => const { compile } = await import('@mdx-js/mdx') try { - const code = await compile({ value, path: meta.path }, compilerOptions) + const code = await compile({ value, path: ctx.file.path }, compilerOptions) if (!enableMinify) return code.toString() @@ -63,7 +63,7 @@ export const mdx = (options: MdxOptions = {}) => }) return minified.code ?? code.toString() } catch (err: any) { - addIssue({ fatal: true, code: 'custom', message: err.message }) + ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) return null as never } }) diff --git a/src/schemas/metadata.ts b/src/schemas/metadata.ts index 6320787b..6b66d053 100644 --- a/src/schemas/metadata.ts +++ b/src/schemas/metadata.ts @@ -1,4 +1,4 @@ -import { custom } from './zod' +import { custom } from '../zod' // Unicode ranges for Han (Chinese) and Hiragana/Katakana (Japanese) characters const cjRanges = [ @@ -60,10 +60,10 @@ export interface Metadata { } export const metadata = () => - custom(i => i === undefined || typeof i === 'string').transform(async (value, { meta, addIssue }) => { - value = value ?? meta.plain + custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { + value = value ?? ctx.file.plain if (value == null || value.length === 0) { - addIssue({ code: 'custom', message: 'The content is empty' }) + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return { readingTime: 0, wordCount: 0 } } diff --git a/src/schemas/path.ts b/src/schemas/path.ts index bd32af73..d8fc711c 100644 --- a/src/schemas/path.ts +++ b/src/schemas/path.ts @@ -1,6 +1,6 @@ import { relative } from 'node:path' -import { custom } from './zod' +import { custom } from '../zod' /** * Options for flattened path @@ -23,12 +23,12 @@ export interface PathOptions { * @returns flattened path based on the file path */ export const path = (options?: PathOptions) => - custom(i => i === undefined || typeof i === 'string').transform(async (value, { meta, addIssue }) => { + custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { if (value != null) { - addIssue({ fatal: false, code: 'custom', message: '`s.path()` schema will resolve the flattening path based on the file path' }) + ctx.addIssue({ fatal: false, code: 'custom', message: '`s.path()` schema will resolve the flattening path based on the file path' }) } - const flattened = relative(meta.config.root, meta.path) + const flattened = relative(ctx.file.config.root, ctx.file.path) .replace(/\.[^.]+$/, '') .replace(/\\/g, '/') diff --git a/src/schemas/raw.ts b/src/schemas/raw.ts index fa5778a1..7da51e39 100644 --- a/src/schemas/raw.ts +++ b/src/schemas/raw.ts @@ -1,4 +1,6 @@ -import { custom } from './zod' +import { custom } from '../zod' export const raw = () => - custom(i => i === undefined || typeof i === 'string').transform(async (value, { meta }) => value ?? meta.content ?? '') + custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { + return value ?? ctx.file.content ?? '' + }) diff --git a/src/schemas/slug.ts b/src/schemas/slug.ts index 82bdbc21..001934c3 100644 --- a/src/schemas/slug.ts +++ b/src/schemas/slug.ts @@ -1,4 +1,4 @@ -import { string } from './zod' +import { string } from '../zod' /** * generate a slug schema @@ -12,12 +12,12 @@ export const slug = (by: string = 'global', reserved: string[] = []) => .max(200) .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/i, 'Invalid slug') .refine(value => !reserved.includes(value), 'Reserved slug') - .superRefine((value, { path, meta, addIssue }) => { + .superRefine((value, ctx) => { const key = `schemas:slug:${by}:${value}` - const { cache } = meta.config + const { cache } = ctx.file.config if (cache.has(key)) { - addIssue({ fatal: true, code: 'custom', message: `duplicate slug '${value}' in '${meta.path}:${path.join('.')}'` }) + ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate slug '${value}' in '${ctx.file.path}'` }) } else { - cache.set(key, meta.path) + cache.set(key, ctx.file.path) } }) diff --git a/src/schemas/toc.ts b/src/schemas/toc.ts index 92bb5e14..7f68618d 100644 --- a/src/schemas/toc.ts +++ b/src/schemas/toc.ts @@ -3,7 +3,7 @@ import { fromMarkdown } from 'mdast-util-from-markdown' import { toc as extractToc } from 'mdast-util-toc' import { visit } from 'unist-util-visit' -import { custom } from './zod' +import { custom } from '../zod' import type { Options } from 'mdast-util-toc' @@ -99,22 +99,20 @@ const parse = (tree?: List): TocEntry[] => { export const toc = (options?: T) => custom(i => i === undefined || typeof i === 'string').transform( - async (value, { meta, addIssue }) => { - value = value ?? meta.content + async (value, ctx) => { + value = value ?? ctx.file.content if (value == null || value.length === 0) { - addIssue({ code: 'custom', message: 'The content is empty' }) + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return (options?.original ? {} : []) as T extends { original: true } ? TocTree : TocEntry[] } try { - // extract ast tree from markdown/mdx content - const tree = value != null ? fromMarkdown(value) : meta.mdast + const tree = value != null ? fromMarkdown(value) : ctx.file.mdast if (tree == null) throw new Error('No tree found') const tocTree = extractToc(tree, options) - // return the original tree if requested if (options?.original) return tocTree as T extends { original: true } ? TocTree : TocEntry[] return parse(tocTree.map) as T extends { original: true } ? TocTree : TocEntry[] } catch (err: any) { - addIssue({ fatal: true, code: 'custom', message: err.message }) + ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) return null as never } } diff --git a/src/schemas/unique.ts b/src/schemas/unique.ts index 567226de..a1357788 100644 --- a/src/schemas/unique.ts +++ b/src/schemas/unique.ts @@ -1,4 +1,4 @@ -import { string } from './zod' +import { string } from '../zod' /** * generate a unique schema @@ -6,12 +6,12 @@ import { string } from './zod' * @returns unique schema */ export const unique = (by: string = 'global') => - string().superRefine((value, { path, meta, addIssue }) => { + string().superRefine((value, ctx) => { const key = `schemas:unique:${by}:${value}` - const { cache } = meta.config + const { cache } = ctx.file.config if (cache.has(key)) { - addIssue({ fatal: true, code: 'custom', message: `duplicate value '${value}' in '${meta.path}:${path.join('.')}'` }) + ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate value '${value}' in '${ctx.file.path}'` }) } else { - cache.set(key, meta.path) + cache.set(key, ctx.file.path) } }) diff --git a/src/schemas/zod/ZodError.ts b/src/schemas/zod/ZodError.ts deleted file mode 100644 index a765ca55..00000000 --- a/src/schemas/zod/ZodError.ts +++ /dev/null @@ -1,327 +0,0 @@ -import { Primitive } from './helpers/typeAliases' -import { util, ZodParsedType } from './helpers/util' - -import type { TypeOf, ZodType } from '.' - -type allKeys = T extends any ? keyof T : never - -export type inferFlattenedErrors, U = string> = typeToFlattenedError, U> -export type typeToFlattenedError = { - formErrors: U[] - fieldErrors: { - [P in allKeys]?: U[] - } -} - -export const ZodIssueCode = util.arrayToEnum([ - 'invalid_type', - 'invalid_literal', - 'custom', - 'invalid_union', - 'invalid_union_discriminator', - 'invalid_enum_value', - 'unrecognized_keys', - 'invalid_arguments', - 'invalid_return_type', - 'invalid_date', - 'invalid_string', - 'too_small', - 'too_big', - 'invalid_intersection_types', - 'not_multiple_of', - 'not_finite' -]) - -export type ZodIssueCode = keyof typeof ZodIssueCode - -export type ZodIssueBase = { - path: (string | number)[] - message?: string -} - -export interface ZodInvalidTypeIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_type - expected: ZodParsedType - received: ZodParsedType -} - -export interface ZodInvalidLiteralIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_literal - expected: unknown - received: unknown -} - -export interface ZodUnrecognizedKeysIssue extends ZodIssueBase { - code: typeof ZodIssueCode.unrecognized_keys - keys: string[] -} - -export interface ZodInvalidUnionIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_union - unionErrors: ZodError[] -} - -export interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_union_discriminator - options: Primitive[] -} - -export interface ZodInvalidEnumValueIssue extends ZodIssueBase { - received: string | number - code: typeof ZodIssueCode.invalid_enum_value - options: (string | number)[] -} - -export interface ZodInvalidArgumentsIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_arguments - argumentsError: ZodError -} - -export interface ZodInvalidReturnTypeIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_return_type - returnTypeError: ZodError -} - -export interface ZodInvalidDateIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_date -} - -export type StringValidation = - | 'email' - | 'url' - | 'emoji' - | 'uuid' - | 'nanoid' - | 'regex' - | 'cuid' - | 'cuid2' - | 'ulid' - | 'datetime' - | 'date' - | 'time' - | 'duration' - | 'ip' - | 'base64' - | { includes: string; position?: number } - | { startsWith: string } - | { endsWith: string } - -export interface ZodInvalidStringIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_string - validation: StringValidation -} - -export interface ZodTooSmallIssue extends ZodIssueBase { - code: typeof ZodIssueCode.too_small - minimum: number | bigint - inclusive: boolean - exact?: boolean - type: 'array' | 'string' | 'number' | 'set' | 'date' | 'bigint' -} - -export interface ZodTooBigIssue extends ZodIssueBase { - code: typeof ZodIssueCode.too_big - maximum: number | bigint - inclusive: boolean - exact?: boolean - type: 'array' | 'string' | 'number' | 'set' | 'date' | 'bigint' -} - -export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { - code: typeof ZodIssueCode.invalid_intersection_types -} - -export interface ZodNotMultipleOfIssue extends ZodIssueBase { - code: typeof ZodIssueCode.not_multiple_of - multipleOf: number | bigint -} - -export interface ZodNotFiniteIssue extends ZodIssueBase { - code: typeof ZodIssueCode.not_finite -} - -export interface ZodCustomIssue extends ZodIssueBase { - code: typeof ZodIssueCode.custom - params?: { [k: string]: any } -} - -export type DenormalizedError = { [k: string]: DenormalizedError | string[] } - -export type ZodIssueOptionalMessage = - | ZodInvalidTypeIssue - | ZodInvalidLiteralIssue - | ZodUnrecognizedKeysIssue - | ZodInvalidUnionIssue - | ZodInvalidUnionDiscriminatorIssue - | ZodInvalidEnumValueIssue - | ZodInvalidArgumentsIssue - | ZodInvalidReturnTypeIssue - | ZodInvalidDateIssue - | ZodInvalidStringIssue - | ZodTooSmallIssue - | ZodTooBigIssue - | ZodInvalidIntersectionTypesIssue - | ZodNotMultipleOfIssue - | ZodNotFiniteIssue - | ZodCustomIssue - -export type ZodIssue = ZodIssueOptionalMessage & { - fatal?: boolean - message: string -} - -export const quotelessJson = (obj: any) => { - const json = JSON.stringify(obj, null, 2) - return json.replace(/"([^"]+)":/g, '$1:') -} - -type recursiveZodFormattedError = T extends [any, ...any[]] - ? { [K in keyof T]?: ZodFormattedError } - : T extends any[] - ? { [k: number]: ZodFormattedError } - : T extends object - ? { [K in keyof T]?: ZodFormattedError } - : unknown - -export type ZodFormattedError = { - _errors: U[] -} & recursiveZodFormattedError> - -export type inferFormattedError, U = string> = ZodFormattedError, U> - -export class ZodError extends Error { - issues: ZodIssue[] = [] - - get errors() { - return this.issues - } - - constructor(issues: ZodIssue[]) { - super() - - const actualProto = new.target.prototype - if (Object.setPrototypeOf) { - // eslint-disable-next-line ban/ban - Object.setPrototypeOf(this, actualProto) - } else { - ;(this as any).__proto__ = actualProto - } - this.name = 'ZodError' - this.issues = issues - } - - format(): ZodFormattedError - format(mapper: (issue: ZodIssue) => U): ZodFormattedError - format(_mapper?: any) { - const mapper: (issue: ZodIssue) => any = - _mapper || - function (issue: ZodIssue) { - return issue.message - } - const fieldErrors: ZodFormattedError = { _errors: [] } as any - const processError = (error: ZodError) => { - for (const issue of error.issues) { - if (issue.code === 'invalid_union') { - issue.unionErrors.map(processError) - } else if (issue.code === 'invalid_return_type') { - processError(issue.returnTypeError) - } else if (issue.code === 'invalid_arguments') { - processError(issue.argumentsError) - } else if (issue.path.length === 0) { - ;(fieldErrors as any)._errors.push(mapper(issue)) - } else { - let curr: any = fieldErrors - let i = 0 - while (i < issue.path.length) { - const el = issue.path[i] - const terminal = i === issue.path.length - 1 - - if (!terminal) { - curr[el] = curr[el] || { _errors: [] } - // if (typeof el === "string") { - // curr[el] = curr[el] || { _errors: [] }; - // } else if (typeof el === "number") { - // const errorArray: any = []; - // errorArray._errors = []; - // curr[el] = curr[el] || errorArray; - // } - } else { - curr[el] = curr[el] || { _errors: [] } - curr[el]._errors.push(mapper(issue)) - } - - curr = curr[el] - i++ - } - } - } - } - - processError(this) - return fieldErrors - } - - static create = (issues: ZodIssue[]) => { - const error = new ZodError(issues) - return error - } - - static assert(value: unknown): asserts value is ZodError { - if (!(value instanceof ZodError)) { - throw new Error(`Not a ZodError: ${value}`) - } - } - - toString() { - return this.message - } - get message() { - return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2) - } - - get isEmpty(): boolean { - return this.issues.length === 0 - } - - addIssue = (sub: ZodIssue) => { - this.issues = [...this.issues, sub] - } - - addIssues = (subs: ZodIssue[] = []) => { - this.issues = [...this.issues, ...subs] - } - - flatten(): typeToFlattenedError - flatten(mapper?: (issue: ZodIssue) => U): typeToFlattenedError - flatten(mapper: (issue: ZodIssue) => U = (issue: ZodIssue) => issue.message as any): any { - const fieldErrors: any = {} - const formErrors: U[] = [] - for (const sub of this.issues) { - if (sub.path.length > 0) { - fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [] - fieldErrors[sub.path[0]].push(mapper(sub)) - } else { - formErrors.push(mapper(sub)) - } - } - return { formErrors, fieldErrors } - } - - get formErrors() { - return this.flatten() - } -} - -type stripPath = T extends any ? util.OmitKeys : never - -export type IssueData = stripPath & { - path?: (string | number)[] - fatal?: boolean -} - -export type ErrorMapCtx = { - defaultError: string - data: any -} - -export type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => { message: string } diff --git a/src/schemas/zod/errors.ts b/src/schemas/zod/errors.ts deleted file mode 100644 index b86b700a..00000000 --- a/src/schemas/zod/errors.ts +++ /dev/null @@ -1,14 +0,0 @@ -import defaultErrorMap from './locales/en' - -import type { ZodErrorMap } from './ZodError' - -let overrideErrorMap = defaultErrorMap -export { defaultErrorMap } - -export function setErrorMap(map: ZodErrorMap) { - overrideErrorMap = map -} - -export function getErrorMap() { - return overrideErrorMap -} diff --git a/src/schemas/zod/external.ts b/src/schemas/zod/external.ts deleted file mode 100644 index 492b3594..00000000 --- a/src/schemas/zod/external.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './errors' -export * from './helpers/parseUtil' -export * from './helpers/typeAliases' -export * from './helpers/util' -export * from './types' -export * from './ZodError' diff --git a/src/schemas/zod/helpers/enumUtil.ts b/src/schemas/zod/helpers/enumUtil.ts deleted file mode 100644 index af3dcf72..00000000 --- a/src/schemas/zod/helpers/enumUtil.ts +++ /dev/null @@ -1,11 +0,0 @@ -export namespace enumUtil { - type UnionToIntersectionFn = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never - - type GetUnionLast = UnionToIntersectionFn extends () => infer Last ? Last : never - - type UnionToTuple = [T] extends [never] ? Tuple : UnionToTuple>, [GetUnionLast, ...Tuple]> - - type CastToStringTuple = T extends [string, ...string[]] ? T : never - - export type UnionToTupleString = CastToStringTuple> -} diff --git a/src/schemas/zod/helpers/errorUtil.ts b/src/schemas/zod/helpers/errorUtil.ts deleted file mode 100644 index abfb1d86..00000000 --- a/src/schemas/zod/helpers/errorUtil.ts +++ /dev/null @@ -1,5 +0,0 @@ -export namespace errorUtil { - export type ErrMessage = string | { message?: string } - export const errToObj = (message?: ErrMessage) => (typeof message === 'string' ? { message } : message || {}) - export const toString = (message?: ErrMessage): string | undefined => (typeof message === 'string' ? message : message?.message) -} diff --git a/src/schemas/zod/helpers/parseUtil.ts b/src/schemas/zod/helpers/parseUtil.ts deleted file mode 100644 index 77a1c2dc..00000000 --- a/src/schemas/zod/helpers/parseUtil.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { VeliteFile } from '../../../file' -import { getErrorMap } from '../errors' -import defaultErrorMap from '../locales/en' - -import type { IssueData, ZodErrorMap, ZodIssue } from '../ZodError' -import type { ZodParsedType } from './util' - -export const makeIssue = (params: { data: any; path: (string | number)[]; errorMaps: ZodErrorMap[]; issueData: IssueData }): ZodIssue => { - const { data, path, errorMaps, issueData } = params - const fullPath = [...path, ...(issueData.path || [])] - const fullIssue = { - ...issueData, - path: fullPath - } - - if (issueData.message !== undefined) { - return { - ...issueData, - path: fullPath, - message: issueData.message - } - } - - let errorMessage = '' - const maps = errorMaps - .filter(m => !!m) - .slice() - .reverse() as ZodErrorMap[] - for (const map of maps) { - errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message - } - - return { - ...issueData, - path: fullPath, - message: errorMessage - } -} - -export interface ZodMeta extends VeliteFile {} - -export type ParseParams = { - path: (string | number)[] - meta: ZodMeta - errorMap: ZodErrorMap - async: boolean -} - -export type ParsePathComponent = string | number -export type ParsePath = ParsePathComponent[] -export const EMPTY_PATH: ParsePath = [] - -export interface ParseContext { - readonly common: { - readonly issues: ZodIssue[] - readonly contextualErrorMap?: ZodErrorMap - readonly async: boolean - } - readonly path: ParsePath - readonly meta: ZodMeta - readonly schemaErrorMap?: ZodErrorMap - readonly parent: ParseContext | null - readonly data: any - readonly parsedType: ZodParsedType -} - -export type ParseInput = { - data: any - path: (string | number)[] - meta: ZodMeta - parent: ParseContext -} - -export function addIssueToContext(ctx: ParseContext, issueData: IssueData): void { - const overrideMap = getErrorMap() - const issue = makeIssue({ - issueData: issueData, - data: ctx.data, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, // contextual error map is first priority - ctx.schemaErrorMap, // then schema-bound map if available - overrideMap, // then global override map - overrideMap === defaultErrorMap ? undefined : defaultErrorMap // then global default map - ].filter(x => !!x) as ZodErrorMap[] - }) - ctx.common.issues.push(issue) -} - -export type ObjectPair = { - key: SyncParseReturnType - value: SyncParseReturnType -} -export class ParseStatus { - value: 'aborted' | 'dirty' | 'valid' = 'valid' - dirty() { - if (this.value === 'valid') this.value = 'dirty' - } - abort() { - if (this.value !== 'aborted') this.value = 'aborted' - } - - static mergeArray(status: ParseStatus, results: SyncParseReturnType[]): SyncParseReturnType { - const arrayValue: any[] = [] - for (const s of results) { - if (s.status === 'aborted') return INVALID - if (s.status === 'dirty') status.dirty() - arrayValue.push(s.value) - } - - return { status: status.value, value: arrayValue } - } - - static async mergeObjectAsync(status: ParseStatus, pairs: { key: ParseReturnType; value: ParseReturnType }[]): Promise> { - const syncPairs: ObjectPair[] = [] - for (const pair of pairs) { - const key = await pair.key - const value = await pair.value - syncPairs.push({ - key, - value - }) - } - return ParseStatus.mergeObjectSync(status, syncPairs) - } - - static mergeObjectSync( - status: ParseStatus, - pairs: { - key: SyncParseReturnType - value: SyncParseReturnType - alwaysSet?: boolean - }[] - ): SyncParseReturnType { - const finalObject: any = {} - for (const pair of pairs) { - const { key, value } = pair - if (key.status === 'aborted') return INVALID - if (value.status === 'aborted') return INVALID - if (key.status === 'dirty') status.dirty() - if (value.status === 'dirty') status.dirty() - - if (key.value !== '__proto__' && (typeof value.value !== 'undefined' || pair.alwaysSet)) { - finalObject[key.value] = value.value - } - } - - return { status: status.value, value: finalObject } - } -} -export interface ParseResult { - status: 'aborted' | 'dirty' | 'valid' - data: any -} - -export type INVALID = { status: 'aborted' } -export const INVALID: INVALID = Object.freeze({ - status: 'aborted' -}) - -export type DIRTY = { status: 'dirty'; value: T } -export const DIRTY = (value: T): DIRTY => ({ status: 'dirty', value }) - -export type OK = { status: 'valid'; value: T } -export const OK = (value: T): OK => ({ status: 'valid', value }) - -export type SyncParseReturnType = OK | DIRTY | INVALID -export type AsyncParseReturnType = Promise> -export type ParseReturnType = SyncParseReturnType | AsyncParseReturnType - -export const isAborted = (x: ParseReturnType): x is INVALID => (x as any).status === 'aborted' -export const isDirty = (x: ParseReturnType): x is OK | DIRTY => (x as any).status === 'dirty' -export const isValid = (x: ParseReturnType): x is OK => (x as any).status === 'valid' -export const isAsync = (x: ParseReturnType): x is AsyncParseReturnType => typeof Promise !== 'undefined' && x instanceof Promise diff --git a/src/schemas/zod/helpers/partialUtil.ts b/src/schemas/zod/helpers/partialUtil.ts deleted file mode 100644 index 11ac30f2..00000000 --- a/src/schemas/zod/helpers/partialUtil.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodRawShape, ZodTuple, ZodTupleItems, ZodTypeAny } from '../index' - -export namespace partialUtil { - // export type DeepPartial = T extends AnyZodObject - // ? ZodObject< - // { [k in keyof T["_shape"]]: InternalDeepPartial }, - // T["_unknownKeys"], - // T["_catchall"] - // > - // : T extends ZodArray - // ? ZodArray, Card> - // : ZodOptional; - - // { - // // optional: T extends ZodOptional ? T : ZodOptional; - // // array: T extends ZodArray ? ZodArray> : never; - // object: T extends AnyZodObject - // ? ZodObject< - // { [k in keyof T["_shape"]]: DeepPartial }, - // T["_unknownKeys"], - // T["_catchall"] - // > - // : never; - // rest: ReturnType; // ZodOptional; - // }[T extends AnyZodObject - // ? "object" // T extends ZodOptional // ? 'optional' // : - // : "rest"]; - - export type DeepPartial = - T extends ZodObject - ? ZodObject<{ [k in keyof T['shape']]: ZodOptional> }, T['_def']['unknownKeys'], T['_def']['catchall']> - : T extends ZodArray - ? ZodArray, Card> - : T extends ZodOptional - ? ZodOptional> - : T extends ZodNullable - ? ZodNullable> - : T extends ZodTuple - ? { - [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial : never - } extends infer PI - ? PI extends ZodTupleItems - ? ZodTuple - : never - : never - : T - // { - // // optional: T extends ZodOptional ? T : ZodOptional; - // // array: T extends ZodArray ? ZodArray> : never; - // object: T extends ZodObject - // ? ZodOptional< - // ZodObject< - // { [k in keyof Shape]: DeepPartial }, - // Params, - // Catchall - // > - // > - // : never; - // rest: ReturnType; - // }[T extends ZodObject - // ? "object" // T extends ZodOptional // ? 'optional' // : - // : "rest"]; -} diff --git a/src/schemas/zod/helpers/typeAliases.ts b/src/schemas/zod/helpers/typeAliases.ts deleted file mode 100644 index 1b4dda26..00000000 --- a/src/schemas/zod/helpers/typeAliases.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type Primitive = string | number | symbol | bigint | boolean | null | undefined -export type Scalars = Primitive | Primitive[] diff --git a/src/schemas/zod/helpers/util.ts b/src/schemas/zod/helpers/util.ts deleted file mode 100644 index fdb987fb..00000000 --- a/src/schemas/zod/helpers/util.ts +++ /dev/null @@ -1,197 +0,0 @@ -export namespace util { - type AssertEqual = (() => V extends T ? 1 : 2) extends () => V extends U ? 1 : 2 ? true : false - - export type isAny = 0 extends 1 & T ? true : false - export const assertEqual = (val: AssertEqual) => val - export function assertIs(_arg: T): void {} - export function assertNever(_x: never): never { - throw new Error() - } - - export type Omit = Pick> - export type OmitKeys = Pick> - export type MakePartial = Omit & Partial> - export type Exactly = T & Record, never> - - export const arrayToEnum = (items: U): { [k in U[number]]: k } => { - const obj: any = {} - for (const item of items) { - obj[item] = item - } - return obj as any - } - - export const getValidEnumValues = (obj: any) => { - const validKeys = objectKeys(obj).filter((k: any) => typeof obj[obj[k]] !== 'number') - const filtered: any = {} - for (const k of validKeys) { - filtered[k] = obj[k] - } - return objectValues(filtered) - } - - export const objectValues = (obj: any) => { - return objectKeys(obj).map(function (e) { - return obj[e] - }) - } - - export const objectKeys: ObjectConstructor['keys'] = - typeof Object.keys === 'function' // eslint-disable-line ban/ban - ? (obj: any) => Object.keys(obj) // eslint-disable-line ban/ban - : (object: any) => { - const keys = [] - for (const key in object) { - if (Object.prototype.hasOwnProperty.call(object, key)) { - keys.push(key) - } - } - return keys - } - - export const find = (arr: T[], checker: (arg: T) => any): T | undefined => { - for (const item of arr) { - if (checker(item)) return item - } - return undefined - } - - export type identity = objectUtil.identity - export type flatten = objectUtil.flatten - - export type noUndefined = T extends undefined ? never : T - - export const isInteger: NumberConstructor['isInteger'] = - typeof Number.isInteger === 'function' - ? val => Number.isInteger(val) // eslint-disable-line ban/ban - : val => typeof val === 'number' && isFinite(val) && Math.floor(val) === val - - export function joinValues(array: T, separator = ' | '): string { - return array.map(val => (typeof val === 'string' ? `'${val}'` : val)).join(separator) - } - - export const jsonStringifyReplacer = (_: string, value: any): any => { - if (typeof value === 'bigint') { - return value.toString() - } - return value - } -} - -export namespace objectUtil { - export type MergeShapes = { - [k in Exclude]: U[k] - } & V - - type optionalKeys = { - [k in keyof T]: undefined extends T[k] ? k : never - }[keyof T] - type requiredKeys = { - [k in keyof T]: undefined extends T[k] ? never : k - }[keyof T] - export type addQuestionMarks = { - [K in requiredKeys]: T[K] - } & { - [K in optionalKeys]?: T[K] - } & { [k in keyof T]?: unknown } - - export type identity = T - export type flatten = identity<{ [k in keyof T]: T[k] }> - - export type noNeverKeys = { - [k in keyof T]: [T[k]] extends [never] ? never : k - }[keyof T] - - export type noNever = identity<{ - [k in noNeverKeys]: k extends keyof T ? T[k] : never - }> - - export const mergeShapes = (first: U, second: T): T & U => { - return { - ...first, - ...second // second overwrites first - } - } - - export type extendShape = { - [K in keyof A as K extends keyof B ? never : K]: A[K] - } & { - [K in keyof B]: B[K] - } -} - -export const ZodParsedType = util.arrayToEnum([ - 'string', - 'nan', - 'number', - 'integer', - 'float', - 'boolean', - 'date', - 'bigint', - 'symbol', - 'function', - 'undefined', - 'null', - 'array', - 'object', - 'unknown', - 'promise', - 'void', - 'never', - 'map', - 'set' -]) - -export type ZodParsedType = keyof typeof ZodParsedType - -export const getParsedType = (data: any): ZodParsedType => { - const t = typeof data - - switch (t) { - case 'undefined': - return ZodParsedType.undefined - - case 'string': - return ZodParsedType.string - - case 'number': - return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number - - case 'boolean': - return ZodParsedType.boolean - - case 'function': - return ZodParsedType.function - - case 'bigint': - return ZodParsedType.bigint - - case 'symbol': - return ZodParsedType.symbol - - case 'object': - if (Array.isArray(data)) { - return ZodParsedType.array - } - if (data === null) { - return ZodParsedType.null - } - if (data.then && typeof data.then === 'function' && data.catch && typeof data.catch === 'function') { - return ZodParsedType.promise - } - if (typeof Map !== 'undefined' && data instanceof Map) { - return ZodParsedType.map - } - if (typeof Set !== 'undefined' && data instanceof Set) { - return ZodParsedType.set - } - if (typeof Date !== 'undefined' && data instanceof Date) { - return ZodParsedType.date - } - return ZodParsedType.object - - default: - return ZodParsedType.unknown - } -} diff --git a/src/schemas/zod/index.ts b/src/schemas/zod/index.ts deleted file mode 100644 index 15c748cd..00000000 --- a/src/schemas/zod/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// don't edit this directory manually -// this is a fork of zod -// https://github.com/colinhacks/zod/pull/3023 -export * from './external' diff --git a/src/schemas/zod/locales/en.ts b/src/schemas/zod/locales/en.ts deleted file mode 100644 index d2935419..00000000 --- a/src/schemas/zod/locales/en.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { util, ZodParsedType } from '../helpers/util' -import { ZodErrorMap, ZodIssueCode } from '../ZodError' - -const errorMap: ZodErrorMap = (issue, _ctx) => { - let message: string - switch (issue.code) { - case ZodIssueCode.invalid_type: - if (issue.received === ZodParsedType.undefined) { - message = 'Required' - } else { - message = `Expected ${issue.expected}, received ${issue.received}` - } - break - case ZodIssueCode.invalid_literal: - message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}` - break - case ZodIssueCode.unrecognized_keys: - message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ', ')}` - break - case ZodIssueCode.invalid_union: - message = `Invalid input` - break - case ZodIssueCode.invalid_union_discriminator: - message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}` - break - case ZodIssueCode.invalid_enum_value: - message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'` - break - case ZodIssueCode.invalid_arguments: - message = `Invalid function arguments` - break - case ZodIssueCode.invalid_return_type: - message = `Invalid function return type` - break - case ZodIssueCode.invalid_date: - message = `Invalid date` - break - case ZodIssueCode.invalid_string: - if (typeof issue.validation === 'object') { - if ('includes' in issue.validation) { - message = `Invalid input: must include "${issue.validation.includes}"` - - if (typeof issue.validation.position === 'number') { - message = `${message} at one or more positions greater than or equal to ${issue.validation.position}` - } - } else if ('startsWith' in issue.validation) { - message = `Invalid input: must start with "${issue.validation.startsWith}"` - } else if ('endsWith' in issue.validation) { - message = `Invalid input: must end with "${issue.validation.endsWith}"` - } else { - util.assertNever(issue.validation) - } - } else if (issue.validation !== 'regex') { - message = `Invalid ${issue.validation}` - } else { - message = 'Invalid' - } - break - case ZodIssueCode.too_small: - if (issue.type === 'array') - message = `Array must contain ${issue.exact ? 'exactly' : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)` - else if (issue.type === 'string') - message = `String must contain ${issue.exact ? 'exactly' : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)` - else if (issue.type === 'number') - message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}` - else if (issue.type === 'date') - message = `Date must be ${ - issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than ` - }${new Date(Number(issue.minimum))}` - else message = 'Invalid input' - break - case ZodIssueCode.too_big: - if (issue.type === 'array') - message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)` - else if (issue.type === 'string') - message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)` - else if (issue.type === 'number') - message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}` - else if (issue.type === 'bigint') - message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}` - else if (issue.type === 'date') - message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}` - else message = 'Invalid input' - break - case ZodIssueCode.custom: - message = `Invalid input` - break - case ZodIssueCode.invalid_intersection_types: - message = `Intersection results could not be merged` - break - case ZodIssueCode.not_multiple_of: - message = `Number must be a multiple of ${issue.multipleOf}` - break - case ZodIssueCode.not_finite: - message = 'Number must be finite' - break - default: - message = _ctx.defaultError - util.assertNever(issue) - } - return { message } -} - -export default errorMap diff --git a/src/schemas/zod/types.ts b/src/schemas/zod/types.ts deleted file mode 100644 index fd13287f..00000000 --- a/src/schemas/zod/types.ts +++ /dev/null @@ -1,4847 +0,0 @@ -import { defaultErrorMap, getErrorMap } from './errors' -import { enumUtil } from './helpers/enumUtil' -import { errorUtil } from './helpers/errorUtil' -import { - addIssueToContext, - AsyncParseReturnType, - DIRTY, - INVALID, - isAborted, - isAsync, - isDirty, - isValid, - makeIssue, - OK, - ParseContext, - ParseInput, - ParseParams, - ParsePath, - ParseReturnType, - ParseStatus, - SyncParseReturnType, - ZodMeta -} from './helpers/parseUtil' -import { partialUtil } from './helpers/partialUtil' -import { Primitive } from './helpers/typeAliases' -import { getParsedType, objectUtil, util, ZodParsedType } from './helpers/util' -import { IssueData, StringValidation, ZodCustomIssue, ZodError, ZodErrorMap, ZodIssue, ZodIssueCode } from './ZodError' - -/////////////////////////////////////// -/////////////////////////////////////// -////////// ////////// -////////// ZodType ////////// -////////// ////////// -/////////////////////////////////////// -/////////////////////////////////////// - -export interface RefinementCtx { - addIssue: (arg: IssueData) => void - path: (string | number)[] - meta: ZodMeta -} -export type ZodRawShape = { [k: string]: ZodTypeAny } -export type ZodTypeAny = ZodType -export type TypeOf> = T['_output'] -export type input> = T['_input'] -export type output> = T['_output'] -export type { TypeOf as infer } - -export type CustomErrorParams = Partial> -export interface ZodTypeDef { - errorMap?: ZodErrorMap - description?: string -} - -class ParseInputLazyPath implements ParseInput { - parent: ParseContext - data: any - _path: ParsePath - meta: ZodMeta - _key: string | number | (string | number)[] - _cachedPath: ParsePath = [] - constructor(parent: ParseContext, value: any, path: ParsePath, meta: ZodMeta, key: string | number | (string | number)[]) { - this.parent = parent - this.data = value - this._path = path - this.meta = meta - this._key = key - } - get path() { - if (!this._cachedPath.length) { - if (this._key instanceof Array) { - this._cachedPath.push(...this._path, ...this._key) - } else { - this._cachedPath.push(...this._path, this._key) - } - } - - return this._cachedPath - } -} - -const handleResult = ( - ctx: ParseContext, - result: SyncParseReturnType -): { success: true; data: Output } | { success: false; error: ZodError } => { - if (isValid(result)) { - return { success: true, data: result.value } - } else { - if (!ctx.common.issues.length) { - throw new Error('Validation failed but no issues detected.') - } - - return { - success: false, - get error() { - if ((this as any)._error) return (this as any)._error as Error - const error = new ZodError(ctx.common.issues) - ;(this as any)._error = error - return (this as any)._error - } - } - } -} - -export type RawCreateParams = - | { - errorMap?: ZodErrorMap - invalid_type_error?: string - required_error?: string - message?: string - description?: string - } - | undefined -export type ProcessedCreateParams = { - errorMap?: ZodErrorMap - description?: string -} -function processCreateParams(params: RawCreateParams): ProcessedCreateParams { - if (!params) return {} - const { errorMap, invalid_type_error, required_error, description } = params - if (errorMap && (invalid_type_error || required_error)) { - throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`) - } - if (errorMap) return { errorMap: errorMap, description } - const customMap: ZodErrorMap = (iss, ctx) => { - const { message } = params - - if (iss.code === 'invalid_enum_value') { - return { message: message ?? ctx.defaultError } - } - if (typeof ctx.data === 'undefined') { - return { message: message ?? required_error ?? ctx.defaultError } - } - if (iss.code !== 'invalid_type') return { message: ctx.defaultError } - return { message: message ?? invalid_type_error ?? ctx.defaultError } - } - return { errorMap: customMap, description } -} - -export type SafeParseSuccess = { - success: true - data: Output - error?: never -} -export type SafeParseError = { - success: false - error: ZodError - data?: never -} - -export type SafeParseReturnType = SafeParseSuccess | SafeParseError - -export abstract class ZodType { - readonly _type!: Output - readonly _output!: Output - readonly _input!: Input - readonly _def!: Def - - get description() { - return this._def.description - } - - abstract _parse(input: ParseInput): ParseReturnType - - _getType(input: ParseInput): string { - return getParsedType(input.data) - } - - _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext { - return ( - ctx || { - common: input.parent.common, - data: input.data, - - parsedType: getParsedType(input.data), - - schemaErrorMap: this._def.errorMap, - path: input.path, - meta: input.parent.meta, - parent: input.parent - } - ) - } - - _processInputParams(input: ParseInput): { - status: ParseStatus - ctx: ParseContext - } { - return { - status: new ParseStatus(), - ctx: { - common: input.parent.common, - data: input.data, - - parsedType: getParsedType(input.data), - - schemaErrorMap: this._def.errorMap, - path: input.path, - meta: input.meta, - parent: input.parent - } - } - } - - _parseSync(input: ParseInput): SyncParseReturnType { - const result = this._parse(input) - if (isAsync(result)) { - throw new Error('Synchronous parse encountered promise.') - } - return result - } - - _parseAsync(input: ParseInput): AsyncParseReturnType { - const result = this._parse(input) - return Promise.resolve(result) - } - - parse(data: unknown, params?: Partial): Output { - const result = this.safeParse(data, params) - if (result.success) return result.data - throw result.error - } - - safeParse(data: unknown, params?: Partial): SafeParseReturnType { - const ctx: ParseContext = { - common: { - issues: [], - async: params?.async ?? false, - contextualErrorMap: params?.errorMap - }, - path: params?.path || [], - meta: params?.meta || ({} as ZodMeta), - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - } - const result = this._parseSync({ - data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - - return handleResult(ctx, result) - } - - async parseAsync(data: unknown, params?: Partial): Promise { - const result = await this.safeParseAsync(data, params) - if (result.success) return result.data - throw result.error - } - - async safeParseAsync(data: unknown, params?: Partial): Promise> { - const ctx: ParseContext = { - common: { - issues: [], - contextualErrorMap: params?.errorMap, - async: true - }, - path: params?.path || [], - meta: params?.meta || ({} as ZodMeta), - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - } - - const maybeAsyncResult = this._parse({ - data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)) - return handleResult(ctx, result) - } - - /** Alias of safeParseAsync */ - spa = this.safeParseAsync - - refine( - check: (arg: Output) => arg is RefinedOutput, - message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams) - ): ZodEffects - refine( - check: (arg: Output) => unknown | Promise, - message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams) - ): ZodEffects - refine(check: (arg: Output) => unknown, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects { - const getIssueProperties = (val: Output) => { - if (typeof message === 'string' || typeof message === 'undefined') { - return { message } - } else if (typeof message === 'function') { - return message(val) - } else { - return message - } - } - return this._refinement((val, ctx) => { - const result = check(val) - const setError = () => - ctx.addIssue({ - code: ZodIssueCode.custom, - ...getIssueProperties(val) - }) - if (typeof Promise !== 'undefined' && result instanceof Promise) { - return result.then(data => { - if (!data) { - setError() - return false - } else { - return true - } - }) - } - if (!result) { - setError() - return false - } else { - return true - } - }) - } - - refinement( - check: (arg: Output) => arg is RefinedOutput, - refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData) - ): ZodEffects - refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects - refinement(check: (arg: Output) => unknown, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects { - return this._refinement((val, ctx) => { - if (!check(val)) { - ctx.addIssue(typeof refinementData === 'function' ? refinementData(val, ctx) : refinementData) - return false - } else { - return true - } - }) - } - - _refinement(refinement: RefinementEffect['refinement']): ZodEffects { - return new ZodEffects({ - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: 'refinement', refinement } - }) - } - - superRefine(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects - superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects - superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise): ZodEffects - superRefine(refinement: (arg: Output, ctx: RefinementCtx) => unknown | Promise): ZodEffects { - return this._refinement(refinement) - } - - constructor(def: Def) { - this._def = def - this.parse = this.parse.bind(this) - this.safeParse = this.safeParse.bind(this) - this.parseAsync = this.parseAsync.bind(this) - this.safeParseAsync = this.safeParseAsync.bind(this) - this.spa = this.spa.bind(this) - this.refine = this.refine.bind(this) - this.refinement = this.refinement.bind(this) - this.superRefine = this.superRefine.bind(this) - this.optional = this.optional.bind(this) - this.nullable = this.nullable.bind(this) - this.nullish = this.nullish.bind(this) - this.array = this.array.bind(this) - this.promise = this.promise.bind(this) - this.or = this.or.bind(this) - this.and = this.and.bind(this) - this.transform = this.transform.bind(this) - this.brand = this.brand.bind(this) - this.default = this.default.bind(this) - this.catch = this.catch.bind(this) - this.describe = this.describe.bind(this) - this.pipe = this.pipe.bind(this) - this.readonly = this.readonly.bind(this) - this.isNullable = this.isNullable.bind(this) - this.isOptional = this.isOptional.bind(this) - } - - optional(): ZodOptional { - return ZodOptional.create(this, this._def) as any - } - nullable(): ZodNullable { - return ZodNullable.create(this, this._def) as any - } - nullish(): ZodOptional> { - return this.nullable().optional() - } - array(): ZodArray { - return ZodArray.create(this, this._def) - } - promise(): ZodPromise { - return ZodPromise.create(this, this._def) - } - - or(option: T): ZodUnion<[this, T]> { - return ZodUnion.create([this, option], this._def) as any - } - - and(incoming: T): ZodIntersection { - return ZodIntersection.create(this, incoming, this._def) - } - - transform(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise): ZodEffects { - return new ZodEffects({ - ...processCreateParams(this._def), - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: 'transform', transform } - }) as any - } - - default(def: util.noUndefined): ZodDefault - default(def: () => util.noUndefined): ZodDefault - default(def: any) { - const defaultValueFunc = typeof def === 'function' ? def : () => def - - return new ZodDefault({ - ...processCreateParams(this._def), - innerType: this, - defaultValue: defaultValueFunc, - typeName: ZodFirstPartyTypeKind.ZodDefault - }) as any - } - - brand(brand?: B): ZodBranded - brand(): ZodBranded { - return new ZodBranded({ - typeName: ZodFirstPartyTypeKind.ZodBranded, - type: this, - ...processCreateParams(this._def) - }) - } - - catch(def: Output): ZodCatch - catch(def: (ctx: { error: ZodError; input: Input }) => Output): ZodCatch - catch(def: any) { - const catchValueFunc = typeof def === 'function' ? def : () => def - - return new ZodCatch({ - ...processCreateParams(this._def), - innerType: this, - catchValue: catchValueFunc, - typeName: ZodFirstPartyTypeKind.ZodCatch - }) as any - } - - describe(description: string): this { - const This = (this as any).constructor - return new This({ - ...this._def, - description - }) - } - - pipe(target: T): ZodPipeline { - return ZodPipeline.create(this, target) - } - readonly(): ZodReadonly { - return ZodReadonly.create(this) - } - - isOptional(): boolean { - return this.safeParse(undefined).success - } - isNullable(): boolean { - return this.safeParse(null).success - } -} - -///////////////////////////////////////// -///////////////////////////////////////// -////////// ////////// -////////// ZodString ////////// -////////// ////////// -///////////////////////////////////////// -///////////////////////////////////////// -export type IpVersion = 'v4' | 'v6' -export type ZodStringCheck = - | { kind: 'min'; value: number; message?: string } - | { kind: 'max'; value: number; message?: string } - | { kind: 'length'; value: number; message?: string } - | { kind: 'email'; message?: string } - | { kind: 'url'; message?: string } - | { kind: 'emoji'; message?: string } - | { kind: 'uuid'; message?: string } - | { kind: 'nanoid'; message?: string } - | { kind: 'cuid'; message?: string } - | { kind: 'includes'; value: string; position?: number; message?: string } - | { kind: 'cuid2'; message?: string } - | { kind: 'ulid'; message?: string } - | { kind: 'startsWith'; value: string; message?: string } - | { kind: 'endsWith'; value: string; message?: string } - | { kind: 'regex'; regex: RegExp; message?: string } - | { kind: 'trim'; message?: string } - | { kind: 'toLowerCase'; message?: string } - | { kind: 'toUpperCase'; message?: string } - | { - kind: 'datetime' - offset: boolean - local: boolean - precision: number | null - message?: string - } - | { - kind: 'date' - // withDate: true; - message?: string - } - | { - kind: 'time' - precision: number | null - message?: string - } - | { kind: 'duration'; message?: string } - | { kind: 'ip'; version?: IpVersion; message?: string } - | { kind: 'base64'; message?: string } - -export interface ZodStringDef extends ZodTypeDef { - checks: ZodStringCheck[] - typeName: ZodFirstPartyTypeKind.ZodString - coerce: boolean -} - -const cuidRegex = /^c[^\s-]{8,}$/i -const cuid2Regex = /^[0-9a-z]+$/ -const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/ -// const uuidRegex = -// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i; -const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i -const nanoidRegex = /^[a-z0-9_-]{21}$/i -const durationRegex = - /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/ - -// from https://stackoverflow.com/a/46181/1550155 -// old version: too slow, didn't support unicode -// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; -//old email regex -// const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i; -// eslint-disable-next-line -// const emailRegex = -// /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/; -// const emailRegex = -// /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; -// const emailRegex = -// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i; -const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i -// const emailRegex = -// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i; - -// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression -const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$` -let emojiRegex: RegExp - -// faster, simpler, safer -const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/ - -const ipv6Regex = - /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/ - -// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript -const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/ - -// simple -// const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`; -// no leap year validation -// const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`; -// with leap year validation -const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))` -const dateRegex = new RegExp(`^${dateRegexSource}$`) - -function timeRegexSource(args: { precision?: number | null }) { - // let regex = `\\d{2}:\\d{2}:\\d{2}`; - let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d` - - if (args.precision) { - regex = `${regex}\\.\\d{${args.precision}}` - } else if (args.precision == null) { - regex = `${regex}(\\.\\d+)?` - } - return regex -} -function timeRegex(args: { offset?: boolean; local?: boolean; precision?: number | null }) { - return new RegExp(`^${timeRegexSource(args)}$`) -} - -// Adapted from https://stackoverflow.com/a/3143231 -export function datetimeRegex(args: { precision?: number | null; offset?: boolean; local?: boolean }) { - let regex = `${dateRegexSource}T${timeRegexSource(args)}` - - const opts: string[] = [] - opts.push(args.local ? `Z?` : `Z`) - if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`) - regex = `${regex}(${opts.join('|')})` - return new RegExp(`^${regex}$`) -} - -function isValidIP(ip: string, version?: IpVersion) { - if ((version === 'v4' || !version) && ipv4Regex.test(ip)) { - return true - } - if ((version === 'v6' || !version) && ipv6Regex.test(ip)) { - return true - } - - return false -} - -export class ZodString extends ZodType { - _parse(input: ParseInput): ParseReturnType { - if (this._def.coerce) { - input.data = String(input.data) - } - const parsedType = this._getType(input) - - if (parsedType !== ZodParsedType.string) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.string, - received: ctx.parsedType - }) - return INVALID - } - - const status = new ParseStatus() - let ctx: undefined | ParseContext = undefined - - for (const check of this._def.checks) { - if (check.kind === 'min') { - if (input.data.length < check.value) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: 'string', - inclusive: true, - exact: false, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'max') { - if (input.data.length > check.value) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: 'string', - inclusive: true, - exact: false, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'length') { - const tooBig = input.data.length > check.value - const tooSmall = input.data.length < check.value - if (tooBig || tooSmall) { - ctx = this._getOrReturnCtx(input, ctx) - if (tooBig) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: 'string', - inclusive: true, - exact: true, - message: check.message - }) - } else if (tooSmall) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: 'string', - inclusive: true, - exact: true, - message: check.message - }) - } - status.dirty() - } - } else if (check.kind === 'email') { - if (!emailRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'email', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'emoji') { - if (!emojiRegex) { - emojiRegex = new RegExp(_emojiRegex, 'u') - } - if (!emojiRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'emoji', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'uuid') { - if (!uuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'uuid', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'nanoid') { - if (!nanoidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'nanoid', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'cuid') { - if (!cuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'cuid', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'cuid2') { - if (!cuid2Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'cuid2', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'ulid') { - if (!ulidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'ulid', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'url') { - try { - new URL(input.data) - } catch { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'url', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'regex') { - check.regex.lastIndex = 0 - const testResult = check.regex.test(input.data) - if (!testResult) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'regex', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'trim') { - input.data = input.data.trim() - } else if (check.kind === 'includes') { - if (!(input.data as string).includes(check.value, check.position)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { includes: check.value, position: check.position }, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'toLowerCase') { - input.data = input.data.toLowerCase() - } else if (check.kind === 'toUpperCase') { - input.data = input.data.toUpperCase() - } else if (check.kind === 'startsWith') { - if (!(input.data as string).startsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { startsWith: check.value }, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'endsWith') { - if (!(input.data as string).endsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { endsWith: check.value }, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'datetime') { - const regex = datetimeRegex(check) - - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: 'datetime', - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'date') { - const regex = dateRegex - - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: 'date', - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'time') { - const regex = timeRegex(check) - - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: 'time', - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'duration') { - if (!durationRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'duration', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'ip') { - if (!isValidIP(input.data, check.version)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'ip', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'base64') { - if (!base64Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - validation: 'base64', - code: ZodIssueCode.invalid_string, - message: check.message - }) - status.dirty() - } - } else { - util.assertNever(check) - } - } - - return { status: status.value, value: input.data } - } - - protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage) { - return this.refinement(data => regex.test(data), { - validation, - code: ZodIssueCode.invalid_string, - ...errorUtil.errToObj(message) - }) - } - - _addCheck(check: ZodStringCheck) { - return new ZodString({ - ...this._def, - checks: [...this._def.checks, check] - }) - } - - email(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'email', ...errorUtil.errToObj(message) }) - } - - url(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'url', ...errorUtil.errToObj(message) }) - } - - emoji(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'emoji', ...errorUtil.errToObj(message) }) - } - - uuid(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'uuid', ...errorUtil.errToObj(message) }) - } - nanoid(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'nanoid', ...errorUtil.errToObj(message) }) - } - cuid(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'cuid', ...errorUtil.errToObj(message) }) - } - - cuid2(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'cuid2', ...errorUtil.errToObj(message) }) - } - ulid(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'ulid', ...errorUtil.errToObj(message) }) - } - base64(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'base64', ...errorUtil.errToObj(message) }) - } - - ip(options?: string | { version?: 'v4' | 'v6'; message?: string }) { - return this._addCheck({ kind: 'ip', ...errorUtil.errToObj(options) }) - } - - datetime( - options?: - | string - | { - message?: string | undefined - precision?: number | null - offset?: boolean - local?: boolean - } - ) { - if (typeof options === 'string') { - return this._addCheck({ - kind: 'datetime', - precision: null, - offset: false, - local: false, - message: options - }) - } - return this._addCheck({ - kind: 'datetime', - - precision: typeof options?.precision === 'undefined' ? null : options?.precision, - offset: options?.offset ?? false, - local: options?.local ?? false, - ...errorUtil.errToObj(options?.message) - }) - } - - date(message?: string) { - return this._addCheck({ kind: 'date', message }) - } - - time( - options?: - | string - | { - message?: string | undefined - precision?: number | null - } - ) { - if (typeof options === 'string') { - return this._addCheck({ - kind: 'time', - precision: null, - message: options - }) - } - return this._addCheck({ - kind: 'time', - precision: typeof options?.precision === 'undefined' ? null : options?.precision, - ...errorUtil.errToObj(options?.message) - }) - } - - duration(message?: errorUtil.ErrMessage) { - return this._addCheck({ kind: 'duration', ...errorUtil.errToObj(message) }) - } - - regex(regex: RegExp, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'regex', - regex: regex, - ...errorUtil.errToObj(message) - }) - } - - includes(value: string, options?: { message?: string; position?: number }) { - return this._addCheck({ - kind: 'includes', - value: value, - position: options?.position, - ...errorUtil.errToObj(options?.message) - }) - } - - startsWith(value: string, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'startsWith', - value: value, - ...errorUtil.errToObj(message) - }) - } - - endsWith(value: string, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'endsWith', - value: value, - ...errorUtil.errToObj(message) - }) - } - - min(minLength: number, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'min', - value: minLength, - ...errorUtil.errToObj(message) - }) - } - - max(maxLength: number, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'max', - value: maxLength, - ...errorUtil.errToObj(message) - }) - } - - length(len: number, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'length', - value: len, - ...errorUtil.errToObj(message) - }) - } - - /** - * @deprecated Use z.string().min(1) instead. - * @see {@link ZodString.min} - */ - nonempty(message?: errorUtil.ErrMessage) { - return this.min(1, errorUtil.errToObj(message)) - } - - trim() { - return new ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: 'trim' }] - }) - } - - toLowerCase() { - return new ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: 'toLowerCase' }] - }) - } - - toUpperCase() { - return new ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: 'toUpperCase' }] - }) - } - - get isDatetime() { - return !!this._def.checks.find(ch => ch.kind === 'datetime') - } - - get isDate() { - return !!this._def.checks.find(ch => ch.kind === 'date') - } - - get isTime() { - return !!this._def.checks.find(ch => ch.kind === 'time') - } - get isDuration() { - return !!this._def.checks.find(ch => ch.kind === 'duration') - } - - get isEmail() { - return !!this._def.checks.find(ch => ch.kind === 'email') - } - - get isURL() { - return !!this._def.checks.find(ch => ch.kind === 'url') - } - - get isEmoji() { - return !!this._def.checks.find(ch => ch.kind === 'emoji') - } - - get isUUID() { - return !!this._def.checks.find(ch => ch.kind === 'uuid') - } - get isNANOID() { - return !!this._def.checks.find(ch => ch.kind === 'nanoid') - } - get isCUID() { - return !!this._def.checks.find(ch => ch.kind === 'cuid') - } - - get isCUID2() { - return !!this._def.checks.find(ch => ch.kind === 'cuid2') - } - get isULID() { - return !!this._def.checks.find(ch => ch.kind === 'ulid') - } - get isIP() { - return !!this._def.checks.find(ch => ch.kind === 'ip') - } - get isBase64() { - return !!this._def.checks.find(ch => ch.kind === 'base64') - } - - get minLength() { - let min: number | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'min') { - if (min === null || ch.value > min) min = ch.value - } - } - return min - } - - get maxLength() { - let max: number | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'max') { - if (max === null || ch.value < max) max = ch.value - } - } - return max - } - - static create = (params?: RawCreateParams & { coerce?: true }): ZodString => { - return new ZodString({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodString, - coerce: params?.coerce ?? false, - ...processCreateParams(params) - }) - } -} - -///////////////////////////////////////// -///////////////////////////////////////// -////////// ////////// -////////// ZodNumber ////////// -////////// ////////// -///////////////////////////////////////// -///////////////////////////////////////// -export type ZodNumberCheck = - | { kind: 'min'; value: number; inclusive: boolean; message?: string } - | { kind: 'max'; value: number; inclusive: boolean; message?: string } - | { kind: 'int'; message?: string } - | { kind: 'multipleOf'; value: number; message?: string } - | { kind: 'finite'; message?: string } - -// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034 -function floatSafeRemainder(val: number, step: number) { - const valDecCount = (val.toString().split('.')[1] || '').length - const stepDecCount = (step.toString().split('.')[1] || '').length - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount - const valInt = parseInt(val.toFixed(decCount).replace('.', '')) - const stepInt = parseInt(step.toFixed(decCount).replace('.', '')) - return (valInt % stepInt) / Math.pow(10, decCount) -} - -export interface ZodNumberDef extends ZodTypeDef { - checks: ZodNumberCheck[] - typeName: ZodFirstPartyTypeKind.ZodNumber - coerce: boolean -} - -export class ZodNumber extends ZodType { - _parse(input: ParseInput): ParseReturnType { - if (this._def.coerce) { - input.data = Number(input.data) - } - const parsedType = this._getType(input) - if (parsedType !== ZodParsedType.number) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.number, - received: ctx.parsedType - }) - return INVALID - } - - let ctx: undefined | ParseContext = undefined - const status = new ParseStatus() - - for (const check of this._def.checks) { - if (check.kind === 'int') { - if (!util.isInteger(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: 'integer', - received: 'float', - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'min') { - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: 'number', - inclusive: check.inclusive, - exact: false, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'max') { - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: 'number', - inclusive: check.inclusive, - exact: false, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'multipleOf') { - if (floatSafeRemainder(input.data, check.value) !== 0) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'finite') { - if (!Number.isFinite(input.data)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.not_finite, - message: check.message - }) - status.dirty() - } - } else { - util.assertNever(check) - } - } - - return { status: status.value, value: input.data } - } - - static create = (params?: RawCreateParams & { coerce?: boolean }): ZodNumber => { - return new ZodNumber({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodNumber, - coerce: params?.coerce || false, - ...processCreateParams(params) - }) - } - - gte(value: number, message?: errorUtil.ErrMessage) { - return this.setLimit('min', value, true, errorUtil.toString(message)) - } - min = this.gte - - gt(value: number, message?: errorUtil.ErrMessage) { - return this.setLimit('min', value, false, errorUtil.toString(message)) - } - - lte(value: number, message?: errorUtil.ErrMessage) { - return this.setLimit('max', value, true, errorUtil.toString(message)) - } - max = this.lte - - lt(value: number, message?: errorUtil.ErrMessage) { - return this.setLimit('max', value, false, errorUtil.toString(message)) - } - - protected setLimit(kind: 'min' | 'max', value: number, inclusive: boolean, message?: string) { - return new ZodNumber({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil.toString(message) - } - ] - }) - } - - _addCheck(check: ZodNumberCheck) { - return new ZodNumber({ - ...this._def, - checks: [...this._def.checks, check] - }) - } - - int(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'int', - message: errorUtil.toString(message) - }) - } - - positive(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'min', - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }) - } - - negative(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'max', - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }) - } - - nonpositive(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'max', - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }) - } - - nonnegative(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'min', - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }) - } - - multipleOf(value: number, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'multipleOf', - value: value, - message: errorUtil.toString(message) - }) - } - step = this.multipleOf - - finite(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'finite', - message: errorUtil.toString(message) - }) - } - - safe(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'min', - inclusive: true, - value: Number.MIN_SAFE_INTEGER, - message: errorUtil.toString(message) - })._addCheck({ - kind: 'max', - inclusive: true, - value: Number.MAX_SAFE_INTEGER, - message: errorUtil.toString(message) - }) - } - - get minValue() { - let min: number | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'min') { - if (min === null || ch.value > min) min = ch.value - } - } - return min - } - - get maxValue() { - let max: number | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'max') { - if (max === null || ch.value < max) max = ch.value - } - } - return max - } - - get isInt() { - return !!this._def.checks.find(ch => ch.kind === 'int' || (ch.kind === 'multipleOf' && util.isInteger(ch.value))) - } - - get isFinite() { - let max: number | null = null, - min: number | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'finite' || ch.kind === 'int' || ch.kind === 'multipleOf') { - return true - } else if (ch.kind === 'min') { - if (min === null || ch.value > min) min = ch.value - } else if (ch.kind === 'max') { - if (max === null || ch.value < max) max = ch.value - } - } - return Number.isFinite(min) && Number.isFinite(max) - } -} - -///////////////////////////////////////// -///////////////////////////////////////// -////////// ////////// -////////// ZodBigInt ////////// -////////// ////////// -///////////////////////////////////////// -///////////////////////////////////////// -export type ZodBigIntCheck = - | { kind: 'min'; value: bigint; inclusive: boolean; message?: string } - | { kind: 'max'; value: bigint; inclusive: boolean; message?: string } - | { kind: 'multipleOf'; value: bigint; message?: string } - -export interface ZodBigIntDef extends ZodTypeDef { - checks: ZodBigIntCheck[] - typeName: ZodFirstPartyTypeKind.ZodBigInt - coerce: boolean -} - -export class ZodBigInt extends ZodType { - _parse(input: ParseInput): ParseReturnType { - if (this._def.coerce) { - input.data = BigInt(input.data) - } - const parsedType = this._getType(input) - if (parsedType !== ZodParsedType.bigint) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.bigint, - received: ctx.parsedType - }) - return INVALID - } - - let ctx: undefined | ParseContext = undefined - const status = new ParseStatus() - - for (const check of this._def.checks) { - if (check.kind === 'min') { - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - type: 'bigint', - minimum: check.value, - inclusive: check.inclusive, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'max') { - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - type: 'bigint', - maximum: check.value, - inclusive: check.inclusive, - message: check.message - }) - status.dirty() - } - } else if (check.kind === 'multipleOf') { - if (input.data % check.value !== BigInt(0)) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }) - status.dirty() - } - } else { - util.assertNever(check) - } - } - - return { status: status.value, value: input.data } - } - - static create = (params?: RawCreateParams & { coerce?: boolean }): ZodBigInt => { - return new ZodBigInt({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodBigInt, - coerce: params?.coerce ?? false, - ...processCreateParams(params) - }) - } - - gte(value: bigint, message?: errorUtil.ErrMessage) { - return this.setLimit('min', value, true, errorUtil.toString(message)) - } - min = this.gte - - gt(value: bigint, message?: errorUtil.ErrMessage) { - return this.setLimit('min', value, false, errorUtil.toString(message)) - } - - lte(value: bigint, message?: errorUtil.ErrMessage) { - return this.setLimit('max', value, true, errorUtil.toString(message)) - } - max = this.lte - - lt(value: bigint, message?: errorUtil.ErrMessage) { - return this.setLimit('max', value, false, errorUtil.toString(message)) - } - - protected setLimit(kind: 'min' | 'max', value: bigint, inclusive: boolean, message?: string) { - return new ZodBigInt({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil.toString(message) - } - ] - }) - } - - _addCheck(check: ZodBigIntCheck) { - return new ZodBigInt({ - ...this._def, - checks: [...this._def.checks, check] - }) - } - - positive(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'min', - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }) - } - - negative(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'max', - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }) - } - - nonpositive(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'max', - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }) - } - - nonnegative(message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'min', - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }) - } - - multipleOf(value: bigint, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'multipleOf', - value, - message: errorUtil.toString(message) - }) - } - - get minValue() { - let min: bigint | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'min') { - if (min === null || ch.value > min) min = ch.value - } - } - return min - } - - get maxValue() { - let max: bigint | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'max') { - if (max === null || ch.value < max) max = ch.value - } - } - return max - } -} - -////////////////////////////////////////// -////////////////////////////////////////// -////////// /////////// -////////// ZodBoolean ////////// -////////// /////////// -////////////////////////////////////////// -////////////////////////////////////////// -export interface ZodBooleanDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodBoolean - coerce: boolean -} - -export class ZodBoolean extends ZodType { - _parse(input: ParseInput): ParseReturnType { - if (this._def.coerce) { - input.data = Boolean(input.data) - } - const parsedType = this._getType(input) - - if (parsedType !== ZodParsedType.boolean) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.boolean, - received: ctx.parsedType - }) - return INVALID - } - return OK(input.data) - } - - static create = (params?: RawCreateParams & { coerce?: boolean }): ZodBoolean => { - return new ZodBoolean({ - typeName: ZodFirstPartyTypeKind.ZodBoolean, - coerce: params?.coerce || false, - ...processCreateParams(params) - }) - } -} - -/////////////////////////////////////// -/////////////////////////////////////// -////////// //////// -////////// ZodDate //////// -////////// //////// -/////////////////////////////////////// -/////////////////////////////////////// -export type ZodDateCheck = { kind: 'min'; value: number; message?: string } | { kind: 'max'; value: number; message?: string } -export interface ZodDateDef extends ZodTypeDef { - checks: ZodDateCheck[] - coerce: boolean - typeName: ZodFirstPartyTypeKind.ZodDate -} - -export class ZodDate extends ZodType { - _parse(input: ParseInput): ParseReturnType { - if (this._def.coerce) { - input.data = new Date(input.data) - } - const parsedType = this._getType(input) - - if (parsedType !== ZodParsedType.date) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.date, - received: ctx.parsedType - }) - return INVALID - } - - if (isNaN(input.data.getTime())) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_date - }) - return INVALID - } - - const status = new ParseStatus() - let ctx: undefined | ParseContext = undefined - - for (const check of this._def.checks) { - if (check.kind === 'min') { - if (input.data.getTime() < check.value) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - message: check.message, - inclusive: true, - exact: false, - minimum: check.value, - type: 'date' - }) - status.dirty() - } - } else if (check.kind === 'max') { - if (input.data.getTime() > check.value) { - ctx = this._getOrReturnCtx(input, ctx) - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - message: check.message, - inclusive: true, - exact: false, - maximum: check.value, - type: 'date' - }) - status.dirty() - } - } else { - util.assertNever(check) - } - } - - return { - status: status.value, - value: new Date((input.data as Date).getTime()) - } - } - - _addCheck(check: ZodDateCheck) { - return new ZodDate({ - ...this._def, - checks: [...this._def.checks, check] - }) - } - - min(minDate: Date, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'min', - value: minDate.getTime(), - message: errorUtil.toString(message) - }) - } - - max(maxDate: Date, message?: errorUtil.ErrMessage) { - return this._addCheck({ - kind: 'max', - value: maxDate.getTime(), - message: errorUtil.toString(message) - }) - } - - get minDate() { - let min: number | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'min') { - if (min === null || ch.value > min) min = ch.value - } - } - - return min != null ? new Date(min) : null - } - - get maxDate() { - let max: number | null = null - for (const ch of this._def.checks) { - if (ch.kind === 'max') { - if (max === null || ch.value < max) max = ch.value - } - } - - return max != null ? new Date(max) : null - } - - static create = (params?: RawCreateParams & { coerce?: boolean }): ZodDate => { - return new ZodDate({ - checks: [], - coerce: params?.coerce || false, - typeName: ZodFirstPartyTypeKind.ZodDate, - ...processCreateParams(params) - }) - } -} - -//////////////////////////////////////////// -//////////////////////////////////////////// -////////// ////////// -////////// ZodSymbol ////////// -////////// ////////// -//////////////////////////////////////////// -//////////////////////////////////////////// -export interface ZodSymbolDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodSymbol -} - -export class ZodSymbol extends ZodType { - _parse(input: ParseInput): ParseReturnType { - const parsedType = this._getType(input) - if (parsedType !== ZodParsedType.symbol) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.symbol, - received: ctx.parsedType - }) - return INVALID - } - - return OK(input.data) - } - - static create = (params?: RawCreateParams): ZodSymbol => { - return new ZodSymbol({ - typeName: ZodFirstPartyTypeKind.ZodSymbol, - ...processCreateParams(params) - }) - } -} - -//////////////////////////////////////////// -//////////////////////////////////////////// -////////// ////////// -////////// ZodUndefined ////////// -////////// ////////// -//////////////////////////////////////////// -//////////////////////////////////////////// -export interface ZodUndefinedDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodUndefined -} - -export class ZodUndefined extends ZodType { - _parse(input: ParseInput): ParseReturnType { - const parsedType = this._getType(input) - if (parsedType !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.undefined, - received: ctx.parsedType - }) - return INVALID - } - return OK(input.data) - } - params?: RawCreateParams - - static create = (params?: RawCreateParams): ZodUndefined => { - return new ZodUndefined({ - typeName: ZodFirstPartyTypeKind.ZodUndefined, - ...processCreateParams(params) - }) - } -} - -/////////////////////////////////////// -/////////////////////////////////////// -////////// ////////// -////////// ZodNull ////////// -////////// ////////// -/////////////////////////////////////// -/////////////////////////////////////// -export interface ZodNullDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodNull -} - -export class ZodNull extends ZodType { - _parse(input: ParseInput): ParseReturnType { - const parsedType = this._getType(input) - if (parsedType !== ZodParsedType.null) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.null, - received: ctx.parsedType - }) - return INVALID - } - return OK(input.data) - } - static create = (params?: RawCreateParams): ZodNull => { - return new ZodNull({ - typeName: ZodFirstPartyTypeKind.ZodNull, - ...processCreateParams(params) - }) - } -} - -////////////////////////////////////// -////////////////////////////////////// -////////// ////////// -////////// ZodAny ////////// -////////// ////////// -////////////////////////////////////// -////////////////////////////////////// -export interface ZodAnyDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodAny -} - -export class ZodAny extends ZodType { - // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject. - _any = true as const - _parse(input: ParseInput): ParseReturnType { - return OK(input.data) - } - static create = (params?: RawCreateParams): ZodAny => { - return new ZodAny({ - typeName: ZodFirstPartyTypeKind.ZodAny, - ...processCreateParams(params) - }) - } -} - -////////////////////////////////////////// -////////////////////////////////////////// -////////// ////////// -////////// ZodUnknown ////////// -////////// ////////// -////////////////////////////////////////// -////////////////////////////////////////// -export interface ZodUnknownDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodUnknown -} - -export class ZodUnknown extends ZodType { - // required - _unknown = true as const - _parse(input: ParseInput): ParseReturnType { - return OK(input.data) - } - - static create = (params?: RawCreateParams): ZodUnknown => { - return new ZodUnknown({ - typeName: ZodFirstPartyTypeKind.ZodUnknown, - ...processCreateParams(params) - }) - } -} - -//////////////////////////////////////// -//////////////////////////////////////// -////////// ////////// -////////// ZodNever ////////// -////////// ////////// -//////////////////////////////////////// -//////////////////////////////////////// -export interface ZodNeverDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodNever -} - -export class ZodNever extends ZodType { - _parse(input: ParseInput): ParseReturnType { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.never, - received: ctx.parsedType - }) - return INVALID - } - static create = (params?: RawCreateParams): ZodNever => { - return new ZodNever({ - typeName: ZodFirstPartyTypeKind.ZodNever, - ...processCreateParams(params) - }) - } -} - -/////////////////////////////////////// -/////////////////////////////////////// -////////// ////////// -////////// ZodVoid ////////// -////////// ////////// -/////////////////////////////////////// -/////////////////////////////////////// -export interface ZodVoidDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodVoid -} - -export class ZodVoid extends ZodType { - _parse(input: ParseInput): ParseReturnType { - const parsedType = this._getType(input) - if (parsedType !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.void, - received: ctx.parsedType - }) - return INVALID - } - return OK(input.data) - } - - static create = (params?: RawCreateParams): ZodVoid => { - return new ZodVoid({ - typeName: ZodFirstPartyTypeKind.ZodVoid, - ...processCreateParams(params) - }) - } -} - -//////////////////////////////////////// -//////////////////////////////////////// -////////// ////////// -////////// ZodArray ////////// -////////// ////////// -//////////////////////////////////////// -//////////////////////////////////////// -export interface ZodArrayDef extends ZodTypeDef { - type: T - typeName: ZodFirstPartyTypeKind.ZodArray - exactLength: { value: number; message?: string } | null - minLength: { value: number; message?: string } | null - maxLength: { value: number; message?: string } | null -} - -export type ArrayCardinality = 'many' | 'atleastone' -export type arrayOutputType = Cardinality extends 'atleastone' - ? [T['_output'], ...T['_output'][]] - : T['_output'][] - -export class ZodArray extends ZodType< - arrayOutputType, - ZodArrayDef, - Cardinality extends 'atleastone' ? [T['_input'], ...T['_input'][]] : T['_input'][] -> { - _parse(input: ParseInput): ParseReturnType { - const { ctx, status } = this._processInputParams(input) - - const def = this._def - - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }) - return INVALID - } - - if (def.exactLength !== null) { - const tooBig = ctx.data.length > def.exactLength.value - const tooSmall = ctx.data.length < def.exactLength.value - if (tooBig || tooSmall) { - addIssueToContext(ctx, { - code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, - minimum: (tooSmall ? def.exactLength.value : undefined) as number, - maximum: (tooBig ? def.exactLength.value : undefined) as number, - type: 'array', - inclusive: true, - exact: true, - message: def.exactLength.message - }) - status.dirty() - } - } - - if (def.minLength !== null) { - if (ctx.data.length < def.minLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minLength.value, - type: 'array', - inclusive: true, - exact: false, - message: def.minLength.message - }) - status.dirty() - } - } - - if (def.maxLength !== null) { - if (ctx.data.length > def.maxLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxLength.value, - type: 'array', - inclusive: true, - exact: false, - message: def.maxLength.message - }) - status.dirty() - } - } - - if (ctx.common.async) { - return Promise.all( - ([...ctx.data] as any[]).map((item, i) => { - return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, ctx.meta, i)) - }) - ).then(result => { - return ParseStatus.mergeArray(status, result) - }) - } - - const result = ([...ctx.data] as any[]).map((item, i) => { - return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, ctx.meta, i)) - }) - - return ParseStatus.mergeArray(status, result) - } - - get element() { - return this._def.type - } - - min(minLength: number, message?: errorUtil.ErrMessage): this { - return new ZodArray({ - ...this._def, - minLength: { value: minLength, message: errorUtil.toString(message) } - }) as any - } - - max(maxLength: number, message?: errorUtil.ErrMessage): this { - return new ZodArray({ - ...this._def, - maxLength: { value: maxLength, message: errorUtil.toString(message) } - }) as any - } - - length(len: number, message?: errorUtil.ErrMessage): this { - return new ZodArray({ - ...this._def, - exactLength: { value: len, message: errorUtil.toString(message) } - }) as any - } - - nonempty(message?: errorUtil.ErrMessage): ZodArray { - return this.min(1, message) as any - } - - static create = (schema: T, params?: RawCreateParams): ZodArray => { - return new ZodArray({ - type: schema, - minLength: null, - maxLength: null, - exactLength: null, - typeName: ZodFirstPartyTypeKind.ZodArray, - ...processCreateParams(params) - }) - } -} - -export type ZodNonEmptyArray = ZodArray - -///////////////////////////////////////// -///////////////////////////////////////// -////////// ////////// -////////// ZodObject ////////// -////////// ////////// -///////////////////////////////////////// -///////////////////////////////////////// - -export type UnknownKeysParam = 'passthrough' | 'strict' | 'strip' - -export interface ZodObjectDef< - T extends ZodRawShape = ZodRawShape, - UnknownKeys extends UnknownKeysParam = UnknownKeysParam, - Catchall extends ZodTypeAny = ZodTypeAny -> extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodObject - shape: () => T - catchall: Catchall - unknownKeys: UnknownKeys -} - -export type mergeTypes = { - [k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never -} - -export type objectOutputType< - Shape extends ZodRawShape, - Catchall extends ZodTypeAny, - UnknownKeys extends UnknownKeysParam = UnknownKeysParam -> = objectUtil.flatten>> & CatchallOutput & PassthroughType - -export type baseObjectOutputType = { - [k in keyof Shape]: Shape[k]['_output'] -} - -export type objectInputType< - Shape extends ZodRawShape, - Catchall extends ZodTypeAny, - UnknownKeys extends UnknownKeysParam = UnknownKeysParam -> = objectUtil.flatten> & CatchallInput & PassthroughType -export type baseObjectInputType = objectUtil.addQuestionMarks<{ - [k in keyof Shape]: Shape[k]['_input'] -}> - -export type CatchallOutput = ZodType extends T ? unknown : { [k: string]: T['_output'] } - -export type CatchallInput = ZodType extends T ? unknown : { [k: string]: T['_input'] } - -export type PassthroughType = T extends 'passthrough' ? { [k: string]: unknown } : unknown - -export type deoptional = T extends ZodOptional ? deoptional : T extends ZodNullable ? ZodNullable> : T - -export type SomeZodObject = ZodObject - -export type noUnrecognized = { - [k in keyof Obj]: k extends keyof Shape ? Obj[k] : never -} - -function deepPartialify(schema: ZodTypeAny): any { - if (schema instanceof ZodObject) { - const newShape: any = {} - - for (const key in schema.shape) { - const fieldSchema = schema.shape[key] - newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)) - } - return new ZodObject({ - ...schema._def, - shape: () => newShape - }) as any - } else if (schema instanceof ZodArray) { - return new ZodArray({ - ...schema._def, - type: deepPartialify(schema.element) - }) - } else if (schema instanceof ZodOptional) { - return ZodOptional.create(deepPartialify(schema.unwrap())) - } else if (schema instanceof ZodNullable) { - return ZodNullable.create(deepPartialify(schema.unwrap())) - } else if (schema instanceof ZodTuple) { - return ZodTuple.create(schema.items.map((item: any) => deepPartialify(item))) - } else { - return schema - } -} - -export class ZodObject< - T extends ZodRawShape, - UnknownKeys extends UnknownKeysParam = UnknownKeysParam, - Catchall extends ZodTypeAny = ZodTypeAny, - Output = objectOutputType, - Input = objectInputType -> extends ZodType, Input> { - private _cached: { shape: T; keys: string[] } | null = null - - _getCached(): { shape: T; keys: string[] } { - if (this._cached !== null) return this._cached - const shape = this._def.shape() - const keys = util.objectKeys(shape) - return (this._cached = { shape, keys }) - } - - _parse(input: ParseInput): ParseReturnType { - const parsedType = this._getType(input) - if (parsedType !== ZodParsedType.object) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }) - return INVALID - } - - const { status, ctx } = this._processInputParams(input) - - const { shape, keys: shapeKeys } = this._getCached() - const extraKeys: string[] = [] - - if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === 'strip')) { - for (const key in ctx.data) { - if (!shapeKeys.includes(key)) { - extraKeys.push(key) - } - } - } - - const pairs: { - key: ParseReturnType - value: ParseReturnType - alwaysSet?: boolean - }[] = [] - for (const key of shapeKeys) { - const keyValidator = shape[key] - const value = ctx.data[key] - pairs.push({ - key: { status: 'valid', value: key }, - value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, ctx.meta, key)), - alwaysSet: key in ctx.data - }) - } - - if (this._def.catchall instanceof ZodNever) { - const unknownKeys = this._def.unknownKeys - - if (unknownKeys === 'passthrough') { - for (const key of extraKeys) { - pairs.push({ - key: { status: 'valid', value: key }, - value: { status: 'valid', value: ctx.data[key] } - }) - } - } else if (unknownKeys === 'strict') { - if (extraKeys.length > 0) { - addIssueToContext(ctx, { - code: ZodIssueCode.unrecognized_keys, - keys: extraKeys - }) - status.dirty() - } - } else if (unknownKeys === 'strip') { - } else { - throw new Error(`Internal ZodObject error: invalid unknownKeys value.`) - } - } else { - // run catchall validation - const catchall = this._def.catchall - - for (const key of extraKeys) { - const value = ctx.data[key] - pairs.push({ - key: { status: 'valid', value: key }, - value: catchall._parse( - new ParseInputLazyPath(ctx, value, ctx.path, ctx.meta, key) //, ctx.child(key), value, getParsedType(value) - ), - alwaysSet: key in ctx.data - }) - } - } - - if (ctx.common.async) { - return Promise.resolve() - .then(async () => { - const syncPairs: any[] = [] - for (const pair of pairs) { - const key = await pair.key - const value = await pair.value - syncPairs.push({ - key, - value, - alwaysSet: pair.alwaysSet - }) - } - return syncPairs - }) - .then(syncPairs => { - return ParseStatus.mergeObjectSync(status, syncPairs) - }) - } else { - return ParseStatus.mergeObjectSync(status, pairs as any) - } - } - - get shape() { - return this._def.shape() - } - - strict(message?: errorUtil.ErrMessage): ZodObject { - errorUtil.errToObj - return new ZodObject({ - ...this._def, - unknownKeys: 'strict', - ...(message !== undefined - ? { - errorMap: (issue, ctx) => { - const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError - if (issue.code === 'unrecognized_keys') - return { - message: errorUtil.errToObj(message).message ?? defaultError - } - return { - message: defaultError - } - } - } - : {}) - }) as any - } - - strip(): ZodObject { - return new ZodObject({ - ...this._def, - unknownKeys: 'strip' - }) as any - } - - passthrough(): ZodObject { - return new ZodObject({ - ...this._def, - unknownKeys: 'passthrough' - }) as any - } - - /** - * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. - * If you want to pass through unknown properties, use `.passthrough()` instead. - */ - nonstrict = this.passthrough - - // const AugmentFactory = - // (def: Def) => - // ( - // augmentation: Augmentation - // ): ZodObject< - // extendShape, Augmentation>, - // Def["unknownKeys"], - // Def["catchall"] - // > => { - // return new ZodObject({ - // ...def, - // shape: () => ({ - // ...def.shape(), - // ...augmentation, - // }), - // }) as any; - // }; - extend(augmentation: Augmentation): ZodObject, UnknownKeys, Catchall> { - return new ZodObject({ - ...this._def, - shape: () => ({ - ...this._def.shape(), - ...augmentation - }) - }) as any - } - // extend< - // Augmentation extends ZodRawShape, - // NewOutput extends util.flatten<{ - // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation - // ? Augmentation[k]["_output"] - // : k extends keyof Output - // ? Output[k] - // : never; - // }>, - // NewInput extends util.flatten<{ - // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation - // ? Augmentation[k]["_input"] - // : k extends keyof Input - // ? Input[k] - // : never; - // }> - // >( - // augmentation: Augmentation - // ): ZodObject< - // extendShape, - // UnknownKeys, - // Catchall, - // NewOutput, - // NewInput - // > { - // return new ZodObject({ - // ...this._def, - // shape: () => ({ - // ...this._def.shape(), - // ...augmentation, - // }), - // }) as any; - // } - /** - * @deprecated Use `.extend` instead - * */ - augment = this.extend - - /** - * Prior to zod@1.0.12 there was a bug in the - * inferred type of merged objects. Please - * upgrade if you are experiencing issues. - */ - merge( - merging: Incoming - ): ZodObject, Incoming['_def']['unknownKeys'], Incoming['_def']['catchall']> { - const merged: any = new ZodObject({ - unknownKeys: merging._def.unknownKeys, - catchall: merging._def.catchall, - shape: () => ({ - ...this._def.shape(), - ...merging._def.shape() - }), - typeName: ZodFirstPartyTypeKind.ZodObject - }) as any - return merged - } - // merge< - // Incoming extends AnyZodObject, - // Augmentation extends Incoming["shape"], - // NewOutput extends { - // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation - // ? Augmentation[k]["_output"] - // : k extends keyof Output - // ? Output[k] - // : never; - // }, - // NewInput extends { - // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation - // ? Augmentation[k]["_input"] - // : k extends keyof Input - // ? Input[k] - // : never; - // } - // >( - // merging: Incoming - // ): ZodObject< - // extendShape>, - // Incoming["_def"]["unknownKeys"], - // Incoming["_def"]["catchall"], - // NewOutput, - // NewInput - // > { - // const merged: any = new ZodObject({ - // unknownKeys: merging._def.unknownKeys, - // catchall: merging._def.catchall, - // shape: () => - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), - // typeName: ZodFirstPartyTypeKind.ZodObject, - // }) as any; - // return merged; - // } - - setKey(key: Key, schema: Schema): ZodObject { - return this.augment({ [key]: schema }) as any - } - // merge( - // merging: Incoming - // ): //ZodObject = (merging) => { - // ZodObject< - // extendShape>, - // Incoming["_def"]["unknownKeys"], - // Incoming["_def"]["catchall"] - // > { - // // const mergedShape = objectUtil.mergeShapes( - // // this._def.shape(), - // // merging._def.shape() - // // ); - // const merged: any = new ZodObject({ - // unknownKeys: merging._def.unknownKeys, - // catchall: merging._def.catchall, - // shape: () => - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), - // typeName: ZodFirstPartyTypeKind.ZodObject, - // }) as any; - // return merged; - // } - - catchall(index: Index): ZodObject { - return new ZodObject({ - ...this._def, - catchall: index - }) as any - } - - pick>(mask: Mask): ZodObject>, UnknownKeys, Catchall> { - const shape: any = {} - - util.objectKeys(mask).forEach(key => { - if (mask[key] && this.shape[key]) { - shape[key] = this.shape[key] - } - }) - - return new ZodObject({ - ...this._def, - shape: () => shape - }) as any - } - - omit>(mask: Mask): ZodObject, UnknownKeys, Catchall> { - const shape: any = {} - - util.objectKeys(this.shape).forEach(key => { - if (!mask[key]) { - shape[key] = this.shape[key] - } - }) - - return new ZodObject({ - ...this._def, - shape: () => shape - }) as any - } - - /** - * @deprecated - */ - deepPartial(): partialUtil.DeepPartial { - return deepPartialify(this) as any - } - - partial(): ZodObject<{ [k in keyof T]: ZodOptional }, UnknownKeys, Catchall> - partial>( - mask: Mask - ): ZodObject< - objectUtil.noNever<{ - [k in keyof T]: k extends keyof Mask ? ZodOptional : T[k] - }>, - UnknownKeys, - Catchall - > - partial(mask?: any) { - const newShape: any = {} - - util.objectKeys(this.shape).forEach(key => { - const fieldSchema = this.shape[key] - - if (mask && !mask[key]) { - newShape[key] = fieldSchema - } else { - newShape[key] = fieldSchema.optional() - } - }) - - return new ZodObject({ - ...this._def, - shape: () => newShape - }) as any - } - - required(): ZodObject<{ [k in keyof T]: deoptional }, UnknownKeys, Catchall> - required>( - mask: Mask - ): ZodObject< - objectUtil.noNever<{ - [k in keyof T]: k extends keyof Mask ? deoptional : T[k] - }>, - UnknownKeys, - Catchall - > - required(mask?: any) { - const newShape: any = {} - - util.objectKeys(this.shape).forEach(key => { - if (mask && !mask[key]) { - newShape[key] = this.shape[key] - } else { - const fieldSchema = this.shape[key] - let newField = fieldSchema - - while (newField instanceof ZodOptional) { - newField = (newField as ZodOptional)._def.innerType - } - - newShape[key] = newField - } - }) - - return new ZodObject({ - ...this._def, - shape: () => newShape - }) as any - } - - keyof(): ZodEnum> { - return createZodEnum(util.objectKeys(this.shape) as [string, ...string[]]) as any - } - - static create = ( - shape: T, - params?: RawCreateParams - ): ZodObject, objectInputType> => { - return new ZodObject({ - shape: () => shape, - unknownKeys: 'strip', - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }) as any - } - - static strictCreate = (shape: T, params?: RawCreateParams): ZodObject => { - return new ZodObject({ - shape: () => shape, - unknownKeys: 'strict', - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }) as any - } - - static lazycreate = (shape: () => T, params?: RawCreateParams): ZodObject => { - return new ZodObject({ - shape, - unknownKeys: 'strip', - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }) as any - } -} - -export type AnyZodObject = ZodObject - -//////////////////////////////////////// -//////////////////////////////////////// -////////// ////////// -////////// ZodUnion ////////// -////////// ////////// -//////////////////////////////////////// -//////////////////////////////////////// -export type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]> -export interface ZodUnionDef> extends ZodTypeDef { - options: T - typeName: ZodFirstPartyTypeKind.ZodUnion -} - -export class ZodUnion extends ZodType, T[number]['_input']> { - _parse(input: ParseInput): ParseReturnType { - const { ctx } = this._processInputParams(input) - const options = this._def.options - - function handleResults(results: { ctx: ParseContext; result: SyncParseReturnType }[]) { - // return first issue-free validation if it exists - for (const result of results) { - if (result.result.status === 'valid') { - return result.result - } - } - - for (const result of results) { - if (result.result.status === 'dirty') { - // add issues from dirty option - - ctx.common.issues.push(...result.ctx.common.issues) - return result.result - } - } - - // return invalid - const unionErrors = results.map(result => new ZodError(result.ctx.common.issues)) - - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }) - return INVALID - } - - if (ctx.common.async) { - return Promise.all( - options.map(async option => { - const childCtx: ParseContext = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - } - return { - result: await option._parseAsync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: childCtx - }), - ctx: childCtx - } - }) - ).then(handleResults) - } else { - let dirty: undefined | { result: DIRTY; ctx: ParseContext } = undefined - const issues: ZodIssue[][] = [] - for (const option of options) { - const childCtx: ParseContext = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - } - const result = option._parseSync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: childCtx - }) - - if (result.status === 'valid') { - return result - } else if (result.status === 'dirty' && !dirty) { - dirty = { result, ctx: childCtx } - } - - if (childCtx.common.issues.length) { - issues.push(childCtx.common.issues) - } - } - - if (dirty) { - ctx.common.issues.push(...dirty.ctx.common.issues) - return dirty.result - } - - const unionErrors = issues.map(issues => new ZodError(issues)) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }) - - return INVALID - } - } - - get options() { - return this._def.options - } - - static create = >(types: T, params?: RawCreateParams): ZodUnion => { - return new ZodUnion({ - options: types, - typeName: ZodFirstPartyTypeKind.ZodUnion, - ...processCreateParams(params) - }) - } -} - -///////////////////////////////////////////////////// -///////////////////////////////////////////////////// -////////// ////////// -////////// ZodDiscriminatedUnion ////////// -////////// ////////// -///////////////////////////////////////////////////// -///////////////////////////////////////////////////// - -const getDiscriminator = (type: T): Primitive[] => { - if (type instanceof ZodLazy) { - return getDiscriminator(type.schema) - } else if (type instanceof ZodEffects) { - return getDiscriminator(type.innerType()) - } else if (type instanceof ZodLiteral) { - return [type.value] - } else if (type instanceof ZodEnum) { - return type.options - } else if (type instanceof ZodNativeEnum) { - // eslint-disable-next-line ban/ban - return util.objectValues(type.enum as any) - } else if (type instanceof ZodDefault) { - return getDiscriminator(type._def.innerType) - } else if (type instanceof ZodUndefined) { - return [undefined] - } else if (type instanceof ZodNull) { - return [null] - } else if (type instanceof ZodOptional) { - return [undefined, ...getDiscriminator(type.unwrap())] - } else if (type instanceof ZodNullable) { - return [null, ...getDiscriminator(type.unwrap())] - } else if (type instanceof ZodBranded) { - return getDiscriminator(type.unwrap()) - } else if (type instanceof ZodReadonly) { - return getDiscriminator(type.unwrap()) - } else if (type instanceof ZodCatch) { - return getDiscriminator(type._def.innerType) - } else { - return [] - } -} - -export type ZodDiscriminatedUnionOption = ZodObject< - { [key in Discriminator]: ZodTypeAny } & ZodRawShape, - UnknownKeysParam, - ZodTypeAny -> - -export interface ZodDiscriminatedUnionDef< - Discriminator extends string, - Options extends ZodDiscriminatedUnionOption[] = ZodDiscriminatedUnionOption[] -> extends ZodTypeDef { - discriminator: Discriminator - options: Options - optionsMap: Map> - typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion -} - -export class ZodDiscriminatedUnion[]> extends ZodType< - output, - ZodDiscriminatedUnionDef, - input -> { - _parse(input: ParseInput): ParseReturnType { - const { ctx } = this._processInputParams(input) - - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }) - return INVALID - } - - const discriminator = this.discriminator - - const discriminatorValue: string = ctx.data[discriminator] - - const option = this.optionsMap.get(discriminatorValue) - - if (!option) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [discriminator] - }) - return INVALID - } - - if (ctx.common.async) { - return option._parseAsync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) as any - } else { - return option._parseSync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) as any - } - } - - get discriminator() { - return this._def.discriminator - } - - get options() { - return this._def.options - } - - get optionsMap() { - return this._def.optionsMap - } - - /** - * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. - * However, it only allows a union of objects, all of which need to share a discriminator property. This property must - * have a different value for each object in the union. - * @param discriminator the name of the discriminator property - * @param types an array of object schemas - * @param params - */ - static create, ...ZodDiscriminatedUnionOption[]]>( - discriminator: Discriminator, - options: Types, - params?: RawCreateParams - ): ZodDiscriminatedUnion { - // Get all the valid discriminator values - const optionsMap: Map = new Map() - - // try { - for (const type of options) { - const discriminatorValues = getDiscriminator(type.shape[discriminator]) - if (!discriminatorValues.length) { - throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`) - } - for (const value of discriminatorValues) { - if (optionsMap.has(value)) { - throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`) - } - - optionsMap.set(value, type) - } - } - - return new ZodDiscriminatedUnion< - Discriminator, - // DiscriminatorValue, - Types - >({ - typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, - discriminator, - options, - optionsMap, - ...processCreateParams(params) - }) - } -} - -/////////////////////////////////////////////// -/////////////////////////////////////////////// -////////// ////////// -////////// ZodIntersection ////////// -////////// ////////// -/////////////////////////////////////////////// -/////////////////////////////////////////////// -export interface ZodIntersectionDef extends ZodTypeDef { - left: T - right: U - typeName: ZodFirstPartyTypeKind.ZodIntersection -} - -function mergeValues(a: any, b: any): { valid: true; data: any } | { valid: false } { - const aType = getParsedType(a) - const bType = getParsedType(b) - - if (a === b) { - return { valid: true, data: a } - } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { - const bKeys = util.objectKeys(b) - const sharedKeys = util.objectKeys(a).filter(key => bKeys.indexOf(key) !== -1) - - const newObj: any = { ...a, ...b } - for (const key of sharedKeys) { - const sharedValue = mergeValues(a[key], b[key]) - if (!sharedValue.valid) { - return { valid: false } - } - newObj[key] = sharedValue.data - } - - return { valid: true, data: newObj } - } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { - if (a.length !== b.length) { - return { valid: false } - } - - const newArray: unknown[] = [] - for (let index = 0; index < a.length; index++) { - const itemA = a[index] - const itemB = b[index] - const sharedValue = mergeValues(itemA, itemB) - - if (!sharedValue.valid) { - return { valid: false } - } - - newArray.push(sharedValue.data) - } - - return { valid: true, data: newArray } - } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) { - return { valid: true, data: a } - } else { - return { valid: false } - } -} - -export class ZodIntersection extends ZodType< - T['_output'] & U['_output'], - ZodIntersectionDef, - T['_input'] & U['_input'] -> { - _parse(input: ParseInput): ParseReturnType { - const { status, ctx } = this._processInputParams(input) - const handleParsed = (parsedLeft: SyncParseReturnType, parsedRight: SyncParseReturnType): SyncParseReturnType => { - if (isAborted(parsedLeft) || isAborted(parsedRight)) { - return INVALID - } - - const merged = mergeValues(parsedLeft.value, parsedRight.value) - - if (!merged.valid) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_intersection_types - }) - return INVALID - } - - if (isDirty(parsedLeft) || isDirty(parsedRight)) { - status.dirty() - } - - return { status: status.value, value: merged.data as any } - } - - if (ctx.common.async) { - return Promise.all([ - this._def.left._parseAsync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }), - this._def.right._parseAsync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - ]).then(([left, right]: any) => handleParsed(left, right)) - } else { - return handleParsed( - this._def.left._parseSync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }), - this._def.right._parseSync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - ) - } - } - - static create = (left: T, right: U, params?: RawCreateParams): ZodIntersection => { - return new ZodIntersection({ - left: left, - right: right, - typeName: ZodFirstPartyTypeKind.ZodIntersection, - ...processCreateParams(params) - }) - } -} - -//////////////////////////////////////// -//////////////////////////////////////// -////////// ////////// -////////// ZodTuple ////////// -////////// ////////// -//////////////////////////////////////// -//////////////////////////////////////// -export type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]] -export type AssertArray = T extends any[] ? T : never -export type OutputTypeOfTuple = AssertArray<{ - [k in keyof T]: T[k] extends ZodType ? T[k]['_output'] : never -}> -export type OutputTypeOfTupleWithRest = Rest extends ZodTypeAny - ? [...OutputTypeOfTuple, ...Rest['_output'][]] - : OutputTypeOfTuple - -export type InputTypeOfTuple = AssertArray<{ - [k in keyof T]: T[k] extends ZodType ? T[k]['_input'] : never -}> -export type InputTypeOfTupleWithRest = Rest extends ZodTypeAny - ? [...InputTypeOfTuple, ...Rest['_input'][]] - : InputTypeOfTuple - -export interface ZodTupleDef extends ZodTypeDef { - items: T - rest: Rest - typeName: ZodFirstPartyTypeKind.ZodTuple -} - -export type AnyZodTuple = ZodTuple<[ZodTypeAny, ...ZodTypeAny[]] | [], ZodTypeAny | null> -export class ZodTuple extends ZodType< - OutputTypeOfTupleWithRest, - ZodTupleDef, - InputTypeOfTupleWithRest -> { - _parse(input: ParseInput): ParseReturnType { - const { status, ctx } = this._processInputParams(input) - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }) - return INVALID - } - - if (ctx.data.length < this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: this._def.items.length, - inclusive: true, - exact: false, - type: 'array' - }) - - return INVALID - } - - const rest = this._def.rest - - if (!rest && ctx.data.length > this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: this._def.items.length, - inclusive: true, - exact: false, - type: 'array' - }) - status.dirty() - } - - const items = ([...ctx.data] as any[]) - .map((item, itemIndex) => { - const schema = this._def.items[itemIndex] || this._def.rest - if (!schema) return null as any as SyncParseReturnType - return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, ctx.meta, itemIndex)) - }) - .filter(x => !!x) // filter nulls - - if (ctx.common.async) { - return Promise.all(items).then(results => { - return ParseStatus.mergeArray(status, results) - }) - } else { - return ParseStatus.mergeArray(status, items as SyncParseReturnType[]) - } - } - - get items() { - return this._def.items - } - - rest(rest: Rest): ZodTuple { - return new ZodTuple({ - ...this._def, - rest - }) - } - - static create = (schemas: T, params?: RawCreateParams): ZodTuple => { - if (!Array.isArray(schemas)) { - throw new Error('You must pass an array of schemas to z.tuple([ ... ])') - } - return new ZodTuple({ - items: schemas, - typeName: ZodFirstPartyTypeKind.ZodTuple, - rest: null, - ...processCreateParams(params) - }) - } -} - -///////////////////////////////////////// -///////////////////////////////////////// -////////// ////////// -////////// ZodRecord ////////// -////////// ////////// -///////////////////////////////////////// -///////////////////////////////////////// -export interface ZodRecordDef extends ZodTypeDef { - valueType: Value - keyType: Key - typeName: ZodFirstPartyTypeKind.ZodRecord -} - -export type KeySchema = ZodType -export type RecordType = [string] extends [K] - ? Record - : [number] extends [K] - ? Record - : [symbol] extends [K] - ? Record - : [BRAND] extends [K] - ? Record - : Partial> -export class ZodRecord extends ZodType< - RecordType, - ZodRecordDef, - RecordType -> { - get keySchema() { - return this._def.keyType - } - get valueSchema() { - return this._def.valueType - } - _parse(input: ParseInput): ParseReturnType { - const { status, ctx } = this._processInputParams(input) - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }) - return INVALID - } - - const pairs: { - key: ParseReturnType - value: ParseReturnType - alwaysSet: boolean - }[] = [] - - const keyType = this._def.keyType - const valueType = this._def.valueType - - for (const key in ctx.data) { - pairs.push({ - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, ctx.meta, key)), - value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, ctx.meta, key)), - alwaysSet: key in ctx.data - }) - } - - if (ctx.common.async) { - return ParseStatus.mergeObjectAsync(status, pairs) - } else { - return ParseStatus.mergeObjectSync(status, pairs as any) - } - } - - get element() { - return this._def.valueType - } - - static create(valueType: Value, params?: RawCreateParams): ZodRecord - static create(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord - static create(first: any, second?: any, third?: any): ZodRecord { - if (second instanceof ZodType) { - return new ZodRecord({ - keyType: first, - valueType: second, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(third) - }) - } - - return new ZodRecord({ - keyType: ZodString.create(), - valueType: first, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(second) - }) - } -} - -////////////////////////////////////// -////////////////////////////////////// -////////// ////////// -////////// ZodMap ////////// -////////// ////////// -////////////////////////////////////// -////////////////////////////////////// -export interface ZodMapDef extends ZodTypeDef { - valueType: Value - keyType: Key - typeName: ZodFirstPartyTypeKind.ZodMap -} - -export class ZodMap extends ZodType< - Map, - ZodMapDef, - Map -> { - get keySchema() { - return this._def.keyType - } - get valueSchema() { - return this._def.valueType - } - _parse(input: ParseInput): ParseReturnType { - const { status, ctx } = this._processInputParams(input) - if (ctx.parsedType !== ZodParsedType.map) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.map, - received: ctx.parsedType - }) - return INVALID - } - - const keyType = this._def.keyType - const valueType = this._def.valueType - - const pairs = [...(ctx.data as Map).entries()].map(([key, value], index) => { - return { - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, ctx.meta, [index, 'key'])), - value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, ctx.meta, [index, 'value'])) - } - }) - - if (ctx.common.async) { - const finalMap = new Map() - return Promise.resolve().then(async () => { - for (const pair of pairs) { - const key = await pair.key - const value = await pair.value - if (key.status === 'aborted' || value.status === 'aborted') { - return INVALID - } - if (key.status === 'dirty' || value.status === 'dirty') { - status.dirty() - } - - finalMap.set(key.value, value.value) - } - return { status: status.value, value: finalMap } - }) - } else { - const finalMap = new Map() - for (const pair of pairs) { - const key = pair.key as SyncParseReturnType - const value = pair.value as SyncParseReturnType - if (key.status === 'aborted' || value.status === 'aborted') { - return INVALID - } - if (key.status === 'dirty' || value.status === 'dirty') { - status.dirty() - } - - finalMap.set(key.value, value.value) - } - return { status: status.value, value: finalMap } - } - } - static create = ( - keyType: Key, - valueType: Value, - params?: RawCreateParams - ): ZodMap => { - return new ZodMap({ - valueType, - keyType, - typeName: ZodFirstPartyTypeKind.ZodMap, - ...processCreateParams(params) - }) - } -} - -////////////////////////////////////// -////////////////////////////////////// -////////// ////////// -////////// ZodSet ////////// -////////// ////////// -////////////////////////////////////// -////////////////////////////////////// -export interface ZodSetDef extends ZodTypeDef { - valueType: Value - typeName: ZodFirstPartyTypeKind.ZodSet - minSize: { value: number; message?: string } | null - maxSize: { value: number; message?: string } | null -} - -export class ZodSet extends ZodType, ZodSetDef, Set> { - _parse(input: ParseInput): ParseReturnType { - const { status, ctx } = this._processInputParams(input) - if (ctx.parsedType !== ZodParsedType.set) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.set, - received: ctx.parsedType - }) - return INVALID - } - - const def = this._def - - if (def.minSize !== null) { - if (ctx.data.size < def.minSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minSize.value, - type: 'set', - inclusive: true, - exact: false, - message: def.minSize.message - }) - status.dirty() - } - } - - if (def.maxSize !== null) { - if (ctx.data.size > def.maxSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxSize.value, - type: 'set', - inclusive: true, - exact: false, - message: def.maxSize.message - }) - status.dirty() - } - } - - const valueType = this._def.valueType - - function finalizeSet(elements: SyncParseReturnType[]) { - const parsedSet = new Set() - for (const element of elements) { - if (element.status === 'aborted') return INVALID - if (element.status === 'dirty') status.dirty() - parsedSet.add(element.value) - } - return { status: status.value, value: parsedSet } - } - - const elements = [...(ctx.data as Set).values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, ctx.meta, i))) - - if (ctx.common.async) { - return Promise.all(elements).then(elements => finalizeSet(elements)) - } else { - return finalizeSet(elements as SyncParseReturnType[]) - } - } - - min(minSize: number, message?: errorUtil.ErrMessage): this { - return new ZodSet({ - ...this._def, - minSize: { value: minSize, message: errorUtil.toString(message) } - }) as any - } - - max(maxSize: number, message?: errorUtil.ErrMessage): this { - return new ZodSet({ - ...this._def, - maxSize: { value: maxSize, message: errorUtil.toString(message) } - }) as any - } - - size(size: number, message?: errorUtil.ErrMessage): this { - return this.min(size, message).max(size, message) as any - } - - nonempty(message?: errorUtil.ErrMessage): ZodSet { - return this.min(1, message) as any - } - - static create = (valueType: Value, params?: RawCreateParams): ZodSet => { - return new ZodSet({ - valueType, - minSize: null, - maxSize: null, - typeName: ZodFirstPartyTypeKind.ZodSet, - ...processCreateParams(params) - }) - } -} - -/////////////////////////////////////////// -/////////////////////////////////////////// -////////// ////////// -////////// ZodFunction ////////// -////////// ////////// -/////////////////////////////////////////// -/////////////////////////////////////////// -export interface ZodFunctionDef = ZodTuple, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef { - args: Args - returns: Returns - typeName: ZodFirstPartyTypeKind.ZodFunction -} - -export type OuterTypeOfFunction, Returns extends ZodTypeAny> = - Args['_input'] extends Array ? (...args: Args['_input']) => Returns['_output'] : never - -export type InnerTypeOfFunction, Returns extends ZodTypeAny> = - Args['_output'] extends Array ? (...args: Args['_output']) => Returns['_input'] : never - -export class ZodFunction, Returns extends ZodTypeAny> extends ZodType< - OuterTypeOfFunction, - ZodFunctionDef, - InnerTypeOfFunction -> { - _parse(input: ParseInput): ParseReturnType { - const { ctx } = this._processInputParams(input) - if (ctx.parsedType !== ZodParsedType.function) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.function, - received: ctx.parsedType - }) - return INVALID - } - - function makeArgsIssue(args: any, error: ZodError): ZodIssue { - return makeIssue({ - data: args, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter(x => !!x) as ZodErrorMap[], - issueData: { - code: ZodIssueCode.invalid_arguments, - argumentsError: error - } - }) - } - - function makeReturnsIssue(returns: any, error: ZodError): ZodIssue { - return makeIssue({ - data: returns, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter(x => !!x) as ZodErrorMap[], - issueData: { - code: ZodIssueCode.invalid_return_type, - returnTypeError: error - } - }) - } - - const params = { errorMap: ctx.common.contextualErrorMap } - const fn = ctx.data - - if (this._def.returns instanceof ZodPromise) { - // Would love a way to avoid disabling this rule, but we need - // an alias (using an arrow function was what caused 2651). - // eslint-disable-next-line @typescript-eslint/no-this-alias - const me = this - return OK(async function (this: any, ...args: any[]) { - const error = new ZodError([]) - const parsedArgs = await me._def.args.parseAsync(args, params).catch(e => { - error.addIssue(makeArgsIssue(args, e)) - throw error - }) - const result = await Reflect.apply(fn, this, parsedArgs as any) - const parsedReturns = await (me._def.returns as unknown as ZodPromise)._def.type.parseAsync(result, params).catch(e => { - error.addIssue(makeReturnsIssue(result, e)) - throw error - }) - return parsedReturns - }) - } else { - // Would love a way to avoid disabling this rule, but we need - // an alias (using an arrow function was what caused 2651). - // eslint-disable-next-line @typescript-eslint/no-this-alias - const me = this - return OK(function (this: any, ...args: any[]) { - const parsedArgs = me._def.args.safeParse(args, params) - if (!parsedArgs.success) { - throw new ZodError([makeArgsIssue(args, parsedArgs.error)]) - } - const result = Reflect.apply(fn, this, parsedArgs.data) - const parsedReturns = me._def.returns.safeParse(result, params) - if (!parsedReturns.success) { - throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]) - } - return parsedReturns.data - }) as any - } - } - - parameters() { - return this._def.args - } - - returnType() { - return this._def.returns - } - - args[0]>(...items: Items): ZodFunction, Returns> { - return new ZodFunction({ - ...this._def, - args: ZodTuple.create(items).rest(ZodUnknown.create()) as any - }) - } - - returns>(returnType: NewReturnType): ZodFunction { - return new ZodFunction({ - ...this._def, - returns: returnType - }) - } - - implement>( - func: F - ): ReturnType extends Returns['_output'] ? (...args: Args['_input']) => ReturnType : OuterTypeOfFunction { - const validatedFunc = this.parse(func) - return validatedFunc as any - } - - strictImplement(func: InnerTypeOfFunction): InnerTypeOfFunction { - const validatedFunc = this.parse(func) - return validatedFunc as any - } - - validate = this.implement - - static create(): ZodFunction, ZodUnknown> - static create>(args: T): ZodFunction - static create(args: T, returns: U): ZodFunction - static create, U extends ZodTypeAny = ZodUnknown>( - args: T, - returns: U, - params?: RawCreateParams - ): ZodFunction - static create(args?: AnyZodTuple, returns?: ZodTypeAny, params?: RawCreateParams) { - return new ZodFunction({ - args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())) as any, - returns: returns || ZodUnknown.create(), - typeName: ZodFirstPartyTypeKind.ZodFunction, - ...processCreateParams(params) - }) as any - } -} - -/////////////////////////////////////// -/////////////////////////////////////// -////////// ////////// -////////// ZodLazy ////////// -////////// ////////// -/////////////////////////////////////// -/////////////////////////////////////// -export interface ZodLazyDef extends ZodTypeDef { - getter: () => T - typeName: ZodFirstPartyTypeKind.ZodLazy -} - -export class ZodLazy extends ZodType, ZodLazyDef, input> { - get schema(): T { - return this._def.getter() - } - - _parse(input: ParseInput): ParseReturnType { - const { ctx } = this._processInputParams(input) - const lazySchema = this._def.getter() - return lazySchema._parse({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - } - - static create = (getter: () => T, params?: RawCreateParams): ZodLazy => { - return new ZodLazy({ - getter: getter, - typeName: ZodFirstPartyTypeKind.ZodLazy, - ...processCreateParams(params) - }) - } -} - -////////////////////////////////////////// -////////////////////////////////////////// -////////// ////////// -////////// ZodLiteral ////////// -////////// ////////// -////////////////////////////////////////// -////////////////////////////////////////// -export interface ZodLiteralDef extends ZodTypeDef { - value: T - typeName: ZodFirstPartyTypeKind.ZodLiteral -} - -export class ZodLiteral extends ZodType, T> { - _parse(input: ParseInput): ParseReturnType { - if (input.data !== this._def.value) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_literal, - expected: this._def.value - }) - return INVALID - } - return { status: 'valid', value: input.data } - } - - get value() { - return this._def.value - } - - static create = (value: T, params?: RawCreateParams): ZodLiteral => { - return new ZodLiteral({ - value: value, - typeName: ZodFirstPartyTypeKind.ZodLiteral, - ...processCreateParams(params) - }) - } -} - -/////////////////////////////////////// -/////////////////////////////////////// -////////// ////////// -////////// ZodEnum ////////// -////////// ////////// -/////////////////////////////////////// -/////////////////////////////////////// -export type ArrayKeys = keyof any[] -export type Indices = Exclude - -export type EnumValues = readonly [T, ...T[]] - -export type Values = { - [k in T[number]]: k -} - -export interface ZodEnumDef extends ZodTypeDef { - values: T - typeName: ZodFirstPartyTypeKind.ZodEnum -} - -export type Writeable = { -readonly [P in keyof T]: T[P] } - -export type FilterEnum = Values extends [] - ? [] - : Values extends [infer Head, ...infer Rest] - ? Head extends ToExclude - ? FilterEnum - : [Head, ...FilterEnum] - : never - -export type typecast = A extends T ? A : never - -function createZodEnum>(values: T, params?: RawCreateParams): ZodEnum> -function createZodEnum(values: T, params?: RawCreateParams): ZodEnum -function createZodEnum(values: [string, ...string[]], params?: RawCreateParams) { - return new ZodEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodEnum, - ...processCreateParams(params) - }) -} - -export class ZodEnum extends ZodType, T[number]> { - #cache: Set | undefined - - _parse(input: ParseInput): ParseReturnType { - if (typeof input.data !== 'string') { - const ctx = this._getOrReturnCtx(input) - const expectedValues = this._def.values - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues) as 'string', - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }) - return INVALID - } - - if (!this.#cache) { - this.#cache = new Set(this._def.values) - } - - if (!this.#cache.has(input.data)) { - const ctx = this._getOrReturnCtx(input) - const expectedValues = this._def.values - - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }) - return INVALID - } - return OK(input.data) - } - - get options() { - return this._def.values - } - - get enum(): Values { - const enumValues: any = {} - for (const val of this._def.values) { - enumValues[val] = val - } - return enumValues as any - } - - get Values(): Values { - const enumValues: any = {} - for (const val of this._def.values) { - enumValues[val] = val - } - return enumValues as any - } - - get Enum(): Values { - const enumValues: any = {} - for (const val of this._def.values) { - enumValues[val] = val - } - return enumValues as any - } - - extract(values: ToExtract, newDef: RawCreateParams = this._def): ZodEnum> { - return ZodEnum.create(values, { - ...this._def, - ...newDef - }) as any - } - - exclude( - values: ToExclude, - newDef: RawCreateParams = this._def - ): ZodEnum>, [string, ...string[]]>> { - return ZodEnum.create(this.options.filter(opt => !values.includes(opt)) as FilterEnum, { - ...this._def, - ...newDef - }) as any - } - - static create = createZodEnum -} - -///////////////////////////////////////////// -///////////////////////////////////////////// -////////// ////////// -////////// ZodNativeEnum ////////// -////////// ////////// -///////////////////////////////////////////// -///////////////////////////////////////////// -export interface ZodNativeEnumDef extends ZodTypeDef { - values: T - typeName: ZodFirstPartyTypeKind.ZodNativeEnum -} - -export type EnumLike = { [k: string]: string | number; [nu: number]: string } - -export class ZodNativeEnum extends ZodType, T[keyof T]> { - #cache: Set | undefined - _parse(input: ParseInput): ParseReturnType { - const nativeEnumValues = util.getValidEnumValues(this._def.values) - - const ctx = this._getOrReturnCtx(input) - if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { - const expectedValues = util.objectValues(nativeEnumValues) - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues) as 'string', - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }) - return INVALID - } - - if (!this.#cache) { - this.#cache = new Set(util.getValidEnumValues(this._def.values)) - } - - if (!this.#cache.has(input.data)) { - const expectedValues = util.objectValues(nativeEnumValues) - - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }) - return INVALID - } - return OK(input.data as any) - } - - get enum() { - return this._def.values - } - - static create = (values: T, params?: RawCreateParams): ZodNativeEnum => { - return new ZodNativeEnum({ - values: values, - typeName: ZodFirstPartyTypeKind.ZodNativeEnum, - ...processCreateParams(params) - }) - } -} - -////////////////////////////////////////// -////////////////////////////////////////// -////////// ////////// -////////// ZodPromise ////////// -////////// ////////// -////////////////////////////////////////// -////////////////////////////////////////// -export interface ZodPromiseDef extends ZodTypeDef { - type: T - typeName: ZodFirstPartyTypeKind.ZodPromise -} - -export class ZodPromise extends ZodType, ZodPromiseDef, Promise> { - unwrap() { - return this._def.type - } - - _parse(input: ParseInput): ParseReturnType { - const { ctx } = this._processInputParams(input) - if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.promise, - received: ctx.parsedType - }) - return INVALID - } - - const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data) - - return OK( - promisified.then((data: any) => { - return this._def.type.parseAsync(data, { - path: ctx.path, - errorMap: ctx.common.contextualErrorMap - }) - }) - ) - } - - static create = (schema: T, params?: RawCreateParams): ZodPromise => { - return new ZodPromise({ - type: schema, - typeName: ZodFirstPartyTypeKind.ZodPromise, - ...processCreateParams(params) - }) - } -} - -////////////////////////////////////////////// -////////////////////////////////////////////// -////////// ////////// -////////// ZodEffects ////////// -////////// ////////// -////////////////////////////////////////////// -////////////////////////////////////////////// - -export type Refinement = (arg: T, ctx: RefinementCtx) => any -export type SuperRefinement = (arg: T, ctx: RefinementCtx) => void | Promise - -export type RefinementEffect = { - type: 'refinement' - refinement: (arg: T, ctx: RefinementCtx) => any -} -export type TransformEffect = { - type: 'transform' - transform: (arg: T, ctx: RefinementCtx) => any -} -export type PreprocessEffect = { - type: 'preprocess' - transform: (arg: T, ctx: RefinementCtx) => any -} -export type Effect = RefinementEffect | TransformEffect | PreprocessEffect - -export interface ZodEffectsDef extends ZodTypeDef { - schema: T - typeName: ZodFirstPartyTypeKind.ZodEffects - effect: Effect -} - -export class ZodEffects, Input = input> extends ZodType, Input> { - innerType() { - return this._def.schema - } - - sourceType(): T { - return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects - ? (this._def.schema as unknown as ZodEffects).sourceType() - : (this._def.schema as T) - } - - _parse(input: ParseInput): ParseReturnType { - const { status, ctx } = this._processInputParams(input) - - const effect = this._def.effect || null - - const checkCtx: RefinementCtx = { - addIssue: (arg: IssueData) => { - addIssueToContext(ctx, arg) - if (arg.fatal) { - status.abort() - } else { - status.dirty() - } - }, - get path() { - return ctx.path - }, - get meta() { - return ctx.meta - } - } - - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx) - - if (effect.type === 'preprocess') { - const processed = effect.transform(ctx.data, checkCtx) - - if (ctx.common.async) { - return Promise.resolve(processed).then(async processed => { - if (status.value === 'aborted') return INVALID - - const result = await this._def.schema._parseAsync({ - data: processed, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - if (result.status === 'aborted') return INVALID - if (result.status === 'dirty') return DIRTY(result.value) - if (status.value === 'dirty') return DIRTY(result.value) - return result - }) - } else { - if (status.value === 'aborted') return INVALID - const result = this._def.schema._parseSync({ - data: processed, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - if (result.status === 'aborted') return INVALID - if (result.status === 'dirty') return DIRTY(result.value) - if (status.value === 'dirty') return DIRTY(result.value) - return result - } - } - if (effect.type === 'refinement') { - const executeRefinement = (acc: unknown): any => { - const result = effect.refinement(acc, checkCtx) - if (ctx.common.async) { - return Promise.resolve(result) - } - if (result instanceof Promise) { - throw new Error('Async refinement encountered during synchronous parse operation. Use .parseAsync instead.') - } - return acc - } - - if (ctx.common.async === false) { - const inner = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - if (inner.status === 'aborted') return INVALID - if (inner.status === 'dirty') status.dirty() - - // return value is ignored - executeRefinement(inner.value) - return { status: status.value, value: inner.value } - } else { - return this._def.schema - ._parseAsync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - .then(inner => { - if (inner.status === 'aborted') return INVALID - if (inner.status === 'dirty') status.dirty() - - return executeRefinement(inner.value).then(() => { - return { status: status.value, value: inner.value } - }) - }) - } - } - - if (effect.type === 'transform') { - if (ctx.common.async === false) { - const base = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - - if (base.status === 'aborted') return base - if (base.status === 'dirty') status.dirty() - - const result = effect.transform(base.value, checkCtx) - if (result instanceof Promise) { - throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`) - } - - return { status: status.value, value: result } - } else { - return this._def.schema - ._parseAsync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - .then(base => { - if (base.status === 'aborted') return base - if (base.status === 'dirty') status.dirty() - - return Promise.resolve(effect.transform(base.value, checkCtx)).then(result => ({ status: status.value, value: result })) - }) - } - } - - util.assertNever(effect) - } - - static create = (schema: I, effect: Effect, params?: RawCreateParams): ZodEffects => { - return new ZodEffects({ - schema, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect, - ...processCreateParams(params) - }) - } - - static createWithPreprocess = ( - preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, - schema: I, - params?: RawCreateParams - ): ZodEffects => { - return new ZodEffects({ - schema, - effect: { type: 'preprocess', transform: preprocess }, - typeName: ZodFirstPartyTypeKind.ZodEffects, - ...processCreateParams(params) - }) - } -} - -export { ZodEffects as ZodTransformer } - -/////////////////////////////////////////// -/////////////////////////////////////////// -////////// ////////// -////////// ZodOptional ////////// -////////// ////////// -/////////////////////////////////////////// -/////////////////////////////////////////// -export interface ZodOptionalDef extends ZodTypeDef { - innerType: T - typeName: ZodFirstPartyTypeKind.ZodOptional -} - -export type ZodOptionalType = ZodOptional - -export class ZodOptional extends ZodType, T['_input'] | undefined> { - _parse(input: ParseInput): ParseReturnType { - const parsedType = this._getType(input) - if (parsedType === ZodParsedType.undefined) { - return OK(undefined) - } - return this._def.innerType._parse(input) - } - - unwrap() { - return this._def.innerType - } - - static create = (type: T, params?: RawCreateParams): ZodOptional => { - return new ZodOptional({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodOptional, - ...processCreateParams(params) - }) as any - } -} - -/////////////////////////////////////////// -/////////////////////////////////////////// -////////// ////////// -////////// ZodNullable ////////// -////////// ////////// -/////////////////////////////////////////// -/////////////////////////////////////////// -export interface ZodNullableDef extends ZodTypeDef { - innerType: T - typeName: ZodFirstPartyTypeKind.ZodNullable -} - -export type ZodNullableType = ZodNullable - -export class ZodNullable extends ZodType, T['_input'] | null> { - _parse(input: ParseInput): ParseReturnType { - const parsedType = this._getType(input) - if (parsedType === ZodParsedType.null) { - return OK(null) - } - return this._def.innerType._parse(input) - } - - unwrap() { - return this._def.innerType - } - - static create = (type: T, params?: RawCreateParams): ZodNullable => { - return new ZodNullable({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodNullable, - ...processCreateParams(params) - }) as any - } -} - -//////////////////////////////////////////// -//////////////////////////////////////////// -////////// ////////// -////////// ZodDefault ////////// -////////// ////////// -//////////////////////////////////////////// -//////////////////////////////////////////// -export interface ZodDefaultDef extends ZodTypeDef { - innerType: T - defaultValue: () => util.noUndefined - typeName: ZodFirstPartyTypeKind.ZodDefault -} - -export class ZodDefault extends ZodType, ZodDefaultDef, T['_input'] | undefined> { - _parse(input: ParseInput): ParseReturnType { - const { ctx } = this._processInputParams(input) - let data = ctx.data - if (ctx.parsedType === ZodParsedType.undefined) { - data = this._def.defaultValue() - } - return this._def.innerType._parse({ - data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - } - - removeDefault() { - return this._def.innerType - } - - static create = ( - type: T, - params: RawCreateParams & { - default: T['_input'] | (() => util.noUndefined) - } - ): ZodDefault => { - return new ZodDefault({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodDefault, - defaultValue: typeof params.default === 'function' ? params.default : () => params.default as any, - ...processCreateParams(params) - }) as any - } -} - -////////////////////////////////////////// -////////////////////////////////////////// -////////// ////////// -////////// ZodCatch ////////// -////////// ////////// -////////////////////////////////////////// -////////////////////////////////////////// -export interface ZodCatchDef extends ZodTypeDef { - innerType: T - catchValue: (ctx: { error: ZodError; input: unknown }) => T['_input'] - typeName: ZodFirstPartyTypeKind.ZodCatch -} - -export class ZodCatch extends ZodType< - T['_output'], - ZodCatchDef, - unknown // any input will pass validation // T["_input"] -> { - _parse(input: ParseInput): ParseReturnType { - const { ctx } = this._processInputParams(input) - - // newCtx is used to not collect issues from inner types in ctx - const newCtx: ParseContext = { - ...ctx, - common: { - ...ctx.common, - issues: [] - } - } - - const result = this._def.innerType._parse({ - data: newCtx.data, - path: newCtx.path, - meta: ctx.meta, - parent: { - ...newCtx - } - }) - - if (isAsync(result)) { - return result.then(result => { - return { - status: 'valid', - value: - result.status === 'valid' - ? result.value - : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues) - }, - input: newCtx.data - }) - } - }) - } else { - return { - status: 'valid', - value: - result.status === 'valid' - ? result.value - : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues) - }, - input: newCtx.data - }) - } - } - } - - removeCatch() { - return this._def.innerType - } - - static create = ( - type: T, - params: RawCreateParams & { - catch: T['_output'] | (() => T['_output']) - } - ): ZodCatch => { - return new ZodCatch({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodCatch, - catchValue: typeof params.catch === 'function' ? params.catch : () => params.catch, - ...processCreateParams(params) - }) - } -} - -///////////////////////////////////////// -///////////////////////////////////////// -////////// ////////// -////////// ZodNaN ////////// -////////// ////////// -///////////////////////////////////////// -///////////////////////////////////////// - -export interface ZodNaNDef extends ZodTypeDef { - typeName: ZodFirstPartyTypeKind.ZodNaN -} - -export class ZodNaN extends ZodType { - _parse(input: ParseInput): ParseReturnType { - const parsedType = this._getType(input) - if (parsedType !== ZodParsedType.nan) { - const ctx = this._getOrReturnCtx(input) - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.nan, - received: ctx.parsedType - }) - return INVALID - } - - return { status: 'valid', value: input.data } - } - - static create = (params?: RawCreateParams): ZodNaN => { - return new ZodNaN({ - typeName: ZodFirstPartyTypeKind.ZodNaN, - ...processCreateParams(params) - }) - } -} - -////////////////////////////////////////// -////////////////////////////////////////// -////////// ////////// -////////// ZodBranded ////////// -////////// ////////// -////////////////////////////////////////// -////////////////////////////////////////// - -export interface ZodBrandedDef extends ZodTypeDef { - type: T - typeName: ZodFirstPartyTypeKind.ZodBranded -} - -export const BRAND: unique symbol = Symbol('zod_brand') -export type BRAND = { - [BRAND]: { [k in T]: true } -} - -export class ZodBranded extends ZodType, ZodBrandedDef, T['_input']> { - _parse(input: ParseInput): ParseReturnType { - const { ctx } = this._processInputParams(input) - const data = ctx.data - return this._def.type._parse({ - data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - } - - unwrap() { - return this._def.type - } -} - -//////////////////////////////////////////// -//////////////////////////////////////////// -////////// ////////// -////////// ZodPipeline ////////// -////////// ////////// -//////////////////////////////////////////// -//////////////////////////////////////////// - -export interface ZodPipelineDef extends ZodTypeDef { - in: A - out: B - typeName: ZodFirstPartyTypeKind.ZodPipeline -} - -export class ZodPipeline extends ZodType, A['_input']> { - _parse(input: ParseInput): ParseReturnType { - const { status, ctx } = this._processInputParams(input) - if (ctx.common.async) { - const handleAsync = async () => { - const inResult = await this._def.in._parseAsync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - if (inResult.status === 'aborted') return INVALID - if (inResult.status === 'dirty') { - status.dirty() - return DIRTY(inResult.value) - } else { - return this._def.out._parseAsync({ - data: inResult.value, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - } - } - return handleAsync() - } else { - const inResult = this._def.in._parseSync({ - data: ctx.data, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - if (inResult.status === 'aborted') return INVALID - if (inResult.status === 'dirty') { - status.dirty() - return { - status: 'dirty', - value: inResult.value - } - } else { - return this._def.out._parseSync({ - data: inResult.value, - path: ctx.path, - meta: ctx.meta, - parent: ctx - }) - } - } - } - - static create(a: A, b: B): ZodPipeline { - return new ZodPipeline({ - in: a, - out: b, - typeName: ZodFirstPartyTypeKind.ZodPipeline - }) - } -} - -/////////////////////////////////////////// -/////////////////////////////////////////// -////////// ////////// -////////// ZodReadonly ////////// -////////// ////////// -/////////////////////////////////////////// -/////////////////////////////////////////// -type BuiltIn = - | (((...args: any[]) => any) | (new (...args: any[]) => any)) - | { readonly [Symbol.toStringTag]: string } - | Date - | Error - | Generator - | Promise - | RegExp - -type MakeReadonly = - T extends Map - ? ReadonlyMap - : T extends Set - ? ReadonlySet - : T extends [infer Head, ...infer Tail] - ? readonly [Head, ...Tail] - : T extends Array - ? ReadonlyArray - : T extends BuiltIn - ? T - : Readonly - -export interface ZodReadonlyDef extends ZodTypeDef { - innerType: T - typeName: ZodFirstPartyTypeKind.ZodReadonly -} - -export class ZodReadonly extends ZodType, ZodReadonlyDef, MakeReadonly> { - _parse(input: ParseInput): ParseReturnType { - const result = this._def.innerType._parse(input) - const freeze = (data: ParseReturnType) => { - if (isValid(data)) { - data.value = Object.freeze(data.value) - } - return data - } - return isAsync(result) ? result.then(data => freeze(data)) : freeze(result) - } - - static create = (type: T, params?: RawCreateParams): ZodReadonly => { - return new ZodReadonly({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodReadonly, - ...processCreateParams(params) - }) as any - } - - unwrap() { - return this._def.innerType - } -} - -//////////////////////////////////////// -//////////////////////////////////////// -////////// ////////// -////////// z.custom ////////// -////////// ////////// -//////////////////////////////////////// -//////////////////////////////////////// -type CustomParams = CustomErrorParams & { fatal?: boolean } -export function custom( - check?: (data: any) => any, - params: string | CustomParams | ((input: any) => CustomParams) = {}, - /** - * @deprecated - * - * Pass `fatal` into the params object instead: - * - * ```ts - * z.string().custom((val) => val.length > 5, { fatal: false }) - * ``` - * - */ - fatal?: boolean -): ZodType { - if (check) - return ZodAny.create().superRefine((data, ctx) => { - if (!check(data)) { - const p = typeof params === 'function' ? params(data) : typeof params === 'string' ? { message: params } : params - const _fatal = p.fatal ?? fatal ?? true - const p2 = typeof p === 'string' ? { message: p } : p - ctx.addIssue({ code: 'custom', ...p2, fatal: _fatal }) - } - }) - return ZodAny.create() -} - -export { ZodType as Schema, ZodType as ZodSchema } - -export const late = { - object: ZodObject.lazycreate -} - -export enum ZodFirstPartyTypeKind { - ZodString = 'ZodString', - ZodNumber = 'ZodNumber', - ZodNaN = 'ZodNaN', - ZodBigInt = 'ZodBigInt', - ZodBoolean = 'ZodBoolean', - ZodDate = 'ZodDate', - ZodSymbol = 'ZodSymbol', - ZodUndefined = 'ZodUndefined', - ZodNull = 'ZodNull', - ZodAny = 'ZodAny', - ZodUnknown = 'ZodUnknown', - ZodNever = 'ZodNever', - ZodVoid = 'ZodVoid', - ZodArray = 'ZodArray', - ZodObject = 'ZodObject', - ZodUnion = 'ZodUnion', - ZodDiscriminatedUnion = 'ZodDiscriminatedUnion', - ZodIntersection = 'ZodIntersection', - ZodTuple = 'ZodTuple', - ZodRecord = 'ZodRecord', - ZodMap = 'ZodMap', - ZodSet = 'ZodSet', - ZodFunction = 'ZodFunction', - ZodLazy = 'ZodLazy', - ZodLiteral = 'ZodLiteral', - ZodEnum = 'ZodEnum', - ZodEffects = 'ZodEffects', - ZodNativeEnum = 'ZodNativeEnum', - ZodOptional = 'ZodOptional', - ZodNullable = 'ZodNullable', - ZodDefault = 'ZodDefault', - ZodCatch = 'ZodCatch', - ZodPromise = 'ZodPromise', - ZodBranded = 'ZodBranded', - ZodPipeline = 'ZodPipeline', - ZodReadonly = 'ZodReadonly' -} -export type ZodFirstPartySchemaTypes = - | ZodString - | ZodNumber - | ZodNaN - | ZodBigInt - | ZodBoolean - | ZodDate - | ZodUndefined - | ZodNull - | ZodAny - | ZodUnknown - | ZodNever - | ZodVoid - | ZodArray - | ZodObject - | ZodUnion - | ZodDiscriminatedUnion - | ZodIntersection - | ZodTuple - | ZodRecord - | ZodMap - | ZodSet - | ZodFunction - | ZodLazy - | ZodLiteral - | ZodEnum - | ZodEffects - | ZodNativeEnum - | ZodOptional - | ZodNullable - | ZodDefault - | ZodCatch - | ZodPromise - | ZodBranded - | ZodPipeline - | ZodReadonly - | ZodSymbol - -// requires TS 4.4+ -abstract class Class { - constructor(..._: any[]) {} -} -const instanceOfType = ( - // const instanceOfType = any>( - cls: T, - params: CustomParams = { - message: `Input not instance of ${cls.name}` - } -) => custom>(data => data instanceof cls, params) - -const stringType = ZodString.create -const numberType = ZodNumber.create -const nanType = ZodNaN.create -const bigIntType = ZodBigInt.create -const booleanType = ZodBoolean.create -const dateType = ZodDate.create -const symbolType = ZodSymbol.create -const undefinedType = ZodUndefined.create -const nullType = ZodNull.create -const anyType = ZodAny.create -const unknownType = ZodUnknown.create -const neverType = ZodNever.create -const voidType = ZodVoid.create -const arrayType = ZodArray.create -const objectType = ZodObject.create -const strictObjectType = ZodObject.strictCreate -const unionType = ZodUnion.create -const discriminatedUnionType = ZodDiscriminatedUnion.create -const intersectionType = ZodIntersection.create -const tupleType = ZodTuple.create -const recordType = ZodRecord.create -const mapType = ZodMap.create -const setType = ZodSet.create -const functionType = ZodFunction.create -const lazyType = ZodLazy.create -const literalType = ZodLiteral.create -const enumType = ZodEnum.create -const nativeEnumType = ZodNativeEnum.create -const promiseType = ZodPromise.create -const effectsType = ZodEffects.create -const optionalType = ZodOptional.create -const nullableType = ZodNullable.create -const preprocessType = ZodEffects.createWithPreprocess -const pipelineType = ZodPipeline.create -const ostring = () => stringType().optional() -const onumber = () => numberType().optional() -const oboolean = () => booleanType().optional() - -export const coerce = { - string: (arg => ZodString.create({ ...arg, coerce: true })) as (typeof ZodString)['create'], - number: (arg => ZodNumber.create({ ...arg, coerce: true })) as (typeof ZodNumber)['create'], - boolean: (arg => - ZodBoolean.create({ - ...arg, - coerce: true - })) as (typeof ZodBoolean)['create'], - bigint: (arg => ZodBigInt.create({ ...arg, coerce: true })) as (typeof ZodBigInt)['create'], - date: (arg => ZodDate.create({ ...arg, coerce: true })) as (typeof ZodDate)['create'] -} - -export { - anyType as any, - arrayType as array, - bigIntType as bigint, - booleanType as boolean, - dateType as date, - discriminatedUnionType as discriminatedUnion, - effectsType as effect, - enumType as enum, - functionType as function, - instanceOfType as instanceof, - intersectionType as intersection, - lazyType as lazy, - literalType as literal, - mapType as map, - nanType as nan, - nativeEnumType as nativeEnum, - neverType as never, - nullType as null, - nullableType as nullable, - numberType as number, - objectType as object, - oboolean, - onumber, - optionalType as optional, - ostring, - pipelineType as pipeline, - preprocessType as preprocess, - promiseType as promise, - recordType as record, - setType as set, - strictObjectType as strictObject, - stringType as string, - symbolType as symbol, - effectsType as transformer, - tupleType as tuple, - undefinedType as undefined, - unionType as union, - unknownType as unknown, - voidType as void -} - -export const NEVER = INVALID as never diff --git a/src/zod.ts b/src/zod.ts new file mode 100644 index 00000000..6dc8d74b --- /dev/null +++ b/src/zod.ts @@ -0,0 +1,70 @@ +import { AsyncLocalStorage } from 'node:async_hooks' +import * as z from 'zod' + +import { logger } from './logger' + +import type { RefinementCtx, ZodType as ZodTypeBase } from 'zod' +import type { VeliteFile } from './file' + +const fileStore = new AsyncLocalStorage() + +const withFileCtx = + (fn: (data: In, ctx: RefinementCtx) => Out) => + (data: In, ctx: RefinementCtx): Out => { + const file = fileStore.getStore() + if (!file) throw new Error('Missing file context for validation') + if (ctx.file == null) { + Object.defineProperty(ctx, 'file', { get: () => file, enumerable: false }) + } + if (ctx.meta == null) { + Object.defineProperty(ctx, 'meta', { get: () => file, enumerable: false }) + } + return fn(data, ctx) + } + +// patch transform/superRefine to attach ctx.meta automatically +const originalTransform = z.ZodType.prototype.transform +z.ZodType.prototype.transform = function (this: ZodTypeBase, fn: (data: any, ctx: RefinementCtx) => any) { + return originalTransform.call(this, withFileCtx(fn)) +} + +const originalSuperRefine = z.ZodType.prototype.superRefine +z.ZodType.prototype.superRefine = function (this: ZodTypeBase, fn: (data: any, ctx: RefinementCtx) => any) { + return originalSuperRefine.call(this, withFileCtx(fn)) +} + +/** + * Run safeParse with file injected. + */ +export const parseWithFile = async (schema: z.ZodType, data: unknown, file: VeliteFile) => + fileStore.run(file, () => { + const originalRun = schema._zod.run + schema._zod.run = (data, ctx) => { + const file = fileStore.getStore() + logger.info(`Running schema: ${file?.config.cache}`) + if (!('file' in data)) { + Object.defineProperty(ctx, 'file', { get: () => file, enumerable: false }) + } + if (!('meta' in data)) { + Object.defineProperty(data, 'meta', { get: () => file, enumerable: false }) + } + return originalRun.call(schema._zod, data, ctx) + } + return schema.safeParseAsync(data) + }) + +export { z } +export type Schema = z.ZodType +export type ZodType = z.ZodType +export type infer = z.infer +export * from 'zod' + +declare module 'zod' { + interface RefinementCtx { + file: VeliteFile + /** + * @deprecated Use `file` instead. + */ + meta: VeliteFile // backward-compatible alias + } +} From 6da0174e20e7cc0972e562ce4051cc36a4f75e03 Mon Sep 17 00:00:00 2001 From: zce Date: Sun, 7 Dec 2025 17:29:14 +0800 Subject: [PATCH 02/48] feat: next demo --- examples/basic/velite.config.js | 6 +-- examples/nextjs/velite.config.ts | 4 +- examples/vite/velite.config.ts | 4 +- src/build.ts | 2 +- src/schemas/excerpt.ts | 6 ++- src/schemas/file.ts | 9 ++-- src/schemas/image.ts | 8 ++-- src/schemas/index.ts | 9 ++-- src/schemas/isodate.ts | 2 +- src/schemas/markdown.ts | 10 +++-- src/schemas/mdx.ts | 10 +++-- src/schemas/metadata.ts | 6 ++- src/schemas/path.ts | 6 ++- src/schemas/raw.ts | 8 ++-- src/schemas/slug.ts | 10 +++-- src/schemas/toc.ts | 8 ++-- src/schemas/unique.ts | 10 +++-- src/schemas/zod.ts | 17 ++++++++ src/zod.ts | 70 -------------------------------- zod | 1 + 20 files changed, 90 insertions(+), 116 deletions(-) create mode 100644 src/schemas/zod.ts delete mode 100644 src/zod.ts create mode 160000 zod diff --git a/examples/basic/velite.config.js b/examples/basic/velite.config.js index fa619921..2fb59b83 100644 --- a/examples/basic/velite.config.js +++ b/examples/basic/velite.config.js @@ -25,11 +25,11 @@ const execAsync = promisify(exec) const timestamp = () => s .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { meta, addIssue }) => { + .transform(async (value, { addIssue }) => { if (value != null) { addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) } - const { stdout } = await execAsync(`git log -1 --format=%cd ${meta.path}`) + const { stdout } = await execAsync(`git log -1 --format=%cd ${s.currentFile().path}`) return new Date(stdout || Date.now()).toISOString() }) @@ -93,7 +93,7 @@ export default defineConfig({ body: s.mdx(), raw: s.raw() }) - .transform((data, { meta }) => ({ ...data, permalink: `/${data.slug}`, basename: meta.basename })) + .transform(data => ({ ...data, permalink: `/${data.slug}`, basename: s.currentFile().basename })) }, posts: { name: 'Post', diff --git a/examples/nextjs/velite.config.ts b/examples/nextjs/velite.config.ts index a89fba3e..3eaeeea3 100644 --- a/examples/nextjs/velite.config.ts +++ b/examples/nextjs/velite.config.ts @@ -26,11 +26,11 @@ const execAsync = promisify(exec) const timestamp = () => s .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { meta, addIssue }) => { + .transform(async (value, { addIssue }) => { if (value != null) { addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) } - const { stdout } = await execAsync(`git log -1 --format=%cd ${meta.path}`) + const { stdout } = await execAsync(`git log -1 --format=%cd ${s.currentFile().path}`) return new Date(stdout || Date.now()).toISOString() }) diff --git a/examples/vite/velite.config.ts b/examples/vite/velite.config.ts index a89fba3e..3eaeeea3 100644 --- a/examples/vite/velite.config.ts +++ b/examples/vite/velite.config.ts @@ -26,11 +26,11 @@ const execAsync = promisify(exec) const timestamp = () => s .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { meta, addIssue }) => { + .transform(async (value, { addIssue }) => { if (value != null) { addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) } - const { stdout } = await execAsync(`git log -1 --format=%cd ${meta.path}`) + const { stdout } = await execAsync(`git log -1 --format=%cd ${s.currentFile().path}`) return new Date(stdout || Date.now()).toISOString() }) diff --git a/src/build.ts b/src/build.ts index 70fc7700..30311987 100644 --- a/src/build.ts +++ b/src/build.ts @@ -8,8 +8,8 @@ import { resolveConfig } from './config' import { VeliteFile } from './file' import { logger } from './logger' import { outputAssets, outputData, outputEntry } from './output' +import { parseWithFile } from './schemas/zod' import { matchPatterns } from './utils' -import { parseWithFile } from './zod' import type { LogLevel } from './logger' import type { Schema } from './schemas' diff --git a/src/schemas/excerpt.ts b/src/schemas/excerpt.ts index 3eeb19d6..4d49c1de 100644 --- a/src/schemas/excerpt.ts +++ b/src/schemas/excerpt.ts @@ -1,4 +1,6 @@ -import { custom } from '../zod' +import { custom } from 'zod' + +import { currentFile } from './zod' export interface ExcerptOptions { // /** @@ -17,7 +19,7 @@ export interface ExcerptOptions { export const excerpt = ({ length = 260 }: ExcerptOptions = {}) => custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - value = value ?? ctx.file.plain + value = value ?? currentFile().plain if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' diff --git a/src/schemas/file.ts b/src/schemas/file.ts index c1db41c0..4c65fdf4 100644 --- a/src/schemas/file.ts +++ b/src/schemas/file.ts @@ -1,5 +1,7 @@ +import { string } from 'zod' + import { isRelativePath, processAsset } from '../assets' -import { string } from '../zod' +import { currentFile } from './zod' export interface FileOptions { /** @@ -16,8 +18,9 @@ export const file = ({ allowNonRelativePath = true }: FileOptions = {}) => string().transform(async (value, ctx) => { try { if (allowNonRelativePath && !isRelativePath(value)) return value - const { output } = ctx.file.config - return await processAsset(value, ctx.file.path, output.name, output.base) + const file = currentFile() + const { output } = file.config + return await processAsset(value, file.path, output.name, output.base) } catch (err) { const message = err instanceof Error ? err.message : String(err) ctx.addIssue({ fatal: true, code: 'custom', message, continue: false }) diff --git a/src/schemas/image.ts b/src/schemas/image.ts index c8c43578..44068805 100644 --- a/src/schemas/image.ts +++ b/src/schemas/image.ts @@ -1,8 +1,9 @@ import { readFile } from 'node:fs/promises' import { join } from 'node:path' +import { string } from 'zod' import { getImageMetadata, processAsset } from '../assets' -import { string } from '../zod' +import { currentFile } from './zod' import type { Image } from '../assets' @@ -42,9 +43,10 @@ export const image = ({ absoluteRoot }: ImageOptions = {}) => // return { src: value, ...metadata } // } - const { output } = ctx.file.config + const file = currentFile() + const { output } = file.config // process asset as relative path - return await processAsset(value, ctx.file.path, output.name, output.base, true) + return await processAsset(value, file.path, output.name, output.base, true) } catch (err) { const message = err instanceof Error ? err.message : String(err) ctx.addIssue({ fatal: true, code: 'custom', message }) diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 46027a54..8e2ec6dd 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,4 +1,5 @@ -import * as z from '../zod' +import * as z from 'zod' + import { excerpt } from './excerpt' import { file } from './file' import { image } from './image' @@ -11,6 +12,7 @@ import { raw } from './raw' import { slug } from './slug' import { toc } from './toc' import { unique } from './unique' +import { currentFile } from './zod' export const s = { ...z, @@ -25,7 +27,8 @@ export const s = { mdx, path, raw, - toc + toc, + currentFile } -export type { infer, Schema, ZodType } from '../zod' +export type { infer, ZodType as Schema, ZodType } from 'zod' diff --git a/src/schemas/isodate.ts b/src/schemas/isodate.ts index 86b2b156..cc4e92c7 100644 --- a/src/schemas/isodate.ts +++ b/src/schemas/isodate.ts @@ -1,4 +1,4 @@ -import { string } from '../zod' +import { string } from 'zod' export const isodate = () => string() diff --git a/src/schemas/markdown.ts b/src/schemas/markdown.ts index 7869b934..cee26922 100644 --- a/src/schemas/markdown.ts +++ b/src/schemas/markdown.ts @@ -5,9 +5,10 @@ import remarkParse from 'remark-parse' import remarkRehype from 'remark-rehype' import { unified } from 'unified' import { visit } from 'unist-util-visit' +import { custom } from 'zod' import { rehypeCopyLinkedFiles } from '../assets' -import { custom } from '../zod' +import { currentFile } from './zod' import type { Root as Hast } from 'hast' import type { Root as Mdast } from 'mdast' @@ -40,13 +41,14 @@ const rehypeMetaString = () => (tree: Hast) => { export const markdown = (options: MarkdownOptions = {}) => custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - value = value ?? ctx.file.content + const file = currentFile() + value = value ?? file.content if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' } - const { markdown, output } = ctx.file.config + const { markdown, output } = file.config const enableGfm = options.gfm ?? markdown?.gfm ?? true const removeComments = options.removeComments ?? markdown?.removeComments ?? true @@ -72,7 +74,7 @@ export const markdown = (options: MarkdownOptions = {}) => .use(rehypeRaw) // turn markdown syntax tree to html syntax tree, with raw html support .use(rehypePlugins) // apply rehype plugins .use(rehypeStringify) // serialize html syntax tree - .process({ value, path: ctx.file.path }) + .process({ value, path: file.path }) return html.toString() } catch (err: any) { ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) diff --git a/src/schemas/mdx.ts b/src/schemas/mdx.ts index 199efb4f..036be8ff 100644 --- a/src/schemas/mdx.ts +++ b/src/schemas/mdx.ts @@ -1,8 +1,9 @@ import remarkGfm from 'remark-gfm' import { visit } from 'unist-util-visit' +import { custom } from 'zod' import { remarkCopyLinkedFiles } from '../assets' -import { custom } from '../zod' +import { currentFile } from './zod' import type { Root } from 'mdast' import type { PluggableList } from 'unified' @@ -19,13 +20,14 @@ const remarkRemoveComments = () => (tree: Root) => { export const mdx = (options: MdxOptions = {}) => custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - value = value ?? ctx.file.content + const file = currentFile() + value = value ?? file.content if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' } - const { mdx, output } = ctx.file.config + const { mdx, output } = file.config const enableGfm = options.gfm ?? mdx?.gfm ?? true const enableMinify = options.minify ?? mdx?.minify ?? true @@ -49,7 +51,7 @@ export const mdx = (options: MdxOptions = {}) => const { compile } = await import('@mdx-js/mdx') try { - const code = await compile({ value, path: ctx.file.path }, compilerOptions) + const code = await compile({ value, path: file.path }, compilerOptions) if (!enableMinify) return code.toString() diff --git a/src/schemas/metadata.ts b/src/schemas/metadata.ts index 6b66d053..807e7901 100644 --- a/src/schemas/metadata.ts +++ b/src/schemas/metadata.ts @@ -1,4 +1,6 @@ -import { custom } from '../zod' +import { custom } from 'zod' + +import { currentFile } from './zod' // Unicode ranges for Han (Chinese) and Hiragana/Katakana (Japanese) characters const cjRanges = [ @@ -61,7 +63,7 @@ export interface Metadata { export const metadata = () => custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - value = value ?? ctx.file.plain + value = value ?? currentFile().plain if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return { readingTime: 0, wordCount: 0 } diff --git a/src/schemas/path.ts b/src/schemas/path.ts index d8fc711c..5bc22d02 100644 --- a/src/schemas/path.ts +++ b/src/schemas/path.ts @@ -1,6 +1,7 @@ import { relative } from 'node:path' +import { custom } from 'zod' -import { custom } from '../zod' +import { currentFile } from './zod' /** * Options for flattened path @@ -28,7 +29,8 @@ export const path = (options?: PathOptions) => ctx.addIssue({ fatal: false, code: 'custom', message: '`s.path()` schema will resolve the flattening path based on the file path' }) } - const flattened = relative(ctx.file.config.root, ctx.file.path) + const file = currentFile() + const flattened = relative(file.config.root, file.path) .replace(/\.[^.]+$/, '') .replace(/\\/g, '/') diff --git a/src/schemas/raw.ts b/src/schemas/raw.ts index 7da51e39..a1a40f35 100644 --- a/src/schemas/raw.ts +++ b/src/schemas/raw.ts @@ -1,6 +1,8 @@ -import { custom } from '../zod' +import { custom } from 'zod' + +import { currentFile } from './zod' export const raw = () => - custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - return value ?? ctx.file.content ?? '' + custom(i => i === undefined || typeof i === 'string').transform(value => { + return value ?? currentFile().content ?? '' }) diff --git a/src/schemas/slug.ts b/src/schemas/slug.ts index 001934c3..d0ad930d 100644 --- a/src/schemas/slug.ts +++ b/src/schemas/slug.ts @@ -1,4 +1,6 @@ -import { string } from '../zod' +import { string } from 'zod' + +import { currentFile } from './zod' /** * generate a slug schema @@ -14,10 +16,10 @@ export const slug = (by: string = 'global', reserved: string[] = []) => .refine(value => !reserved.includes(value), 'Reserved slug') .superRefine((value, ctx) => { const key = `schemas:slug:${by}:${value}` - const { cache } = ctx.file.config + const { cache } = currentFile().config if (cache.has(key)) { - ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate slug '${value}' in '${ctx.file.path}'` }) + ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate slug '${value}' in '${currentFile().path}'` }) } else { - cache.set(key, ctx.file.path) + cache.set(key, currentFile().path) } }) diff --git a/src/schemas/toc.ts b/src/schemas/toc.ts index 7f68618d..a9e418eb 100644 --- a/src/schemas/toc.ts +++ b/src/schemas/toc.ts @@ -2,8 +2,9 @@ import { Link, List, Paragraph } from 'mdast' import { fromMarkdown } from 'mdast-util-from-markdown' import { toc as extractToc } from 'mdast-util-toc' import { visit } from 'unist-util-visit' +import { custom } from 'zod' -import { custom } from '../zod' +import { currentFile } from './zod' import type { Options } from 'mdast-util-toc' @@ -100,13 +101,14 @@ const parse = (tree?: List): TocEntry[] => { export const toc = (options?: T) => custom(i => i === undefined || typeof i === 'string').transform( async (value, ctx) => { - value = value ?? ctx.file.content + const file = currentFile() + value = value ?? file.content if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return (options?.original ? {} : []) as T extends { original: true } ? TocTree : TocEntry[] } try { - const tree = value != null ? fromMarkdown(value) : ctx.file.mdast + const tree = value != null ? fromMarkdown(value) : file.mdast if (tree == null) throw new Error('No tree found') const tocTree = extractToc(tree, options) if (options?.original) return tocTree as T extends { original: true } ? TocTree : TocEntry[] diff --git a/src/schemas/unique.ts b/src/schemas/unique.ts index a1357788..017405dc 100644 --- a/src/schemas/unique.ts +++ b/src/schemas/unique.ts @@ -1,4 +1,6 @@ -import { string } from '../zod' +import { string } from 'zod' + +import { currentFile } from './zod' /** * generate a unique schema @@ -8,10 +10,10 @@ import { string } from '../zod' export const unique = (by: string = 'global') => string().superRefine((value, ctx) => { const key = `schemas:unique:${by}:${value}` - const { cache } = ctx.file.config + const { cache } = currentFile().config if (cache.has(key)) { - ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate value '${value}' in '${ctx.file.path}'` }) + ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate value '${value}' in '${currentFile().path}'` }) } else { - cache.set(key, ctx.file.path) + cache.set(key, currentFile().path) } }) diff --git a/src/schemas/zod.ts b/src/schemas/zod.ts new file mode 100644 index 00000000..a91e238c --- /dev/null +++ b/src/schemas/zod.ts @@ -0,0 +1,17 @@ +import { AsyncLocalStorage } from 'node:async_hooks' + +import type { ZodType } from 'zod' +import type { VeliteFile } from '../file' + +const fileStore = new AsyncLocalStorage() + +export const currentFile = (): VeliteFile => { + const file = fileStore.getStore() + if (!file) throw new Error('Missing file context for validation') + return file +} + +/** + * Run safeParse with file injected. + */ +export const parseWithFile = async (schema: ZodType, data: unknown, file: VeliteFile) => fileStore.run(file, () => schema.safeParseAsync(data)) diff --git a/src/zod.ts b/src/zod.ts deleted file mode 100644 index 6dc8d74b..00000000 --- a/src/zod.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { AsyncLocalStorage } from 'node:async_hooks' -import * as z from 'zod' - -import { logger } from './logger' - -import type { RefinementCtx, ZodType as ZodTypeBase } from 'zod' -import type { VeliteFile } from './file' - -const fileStore = new AsyncLocalStorage() - -const withFileCtx = - (fn: (data: In, ctx: RefinementCtx) => Out) => - (data: In, ctx: RefinementCtx): Out => { - const file = fileStore.getStore() - if (!file) throw new Error('Missing file context for validation') - if (ctx.file == null) { - Object.defineProperty(ctx, 'file', { get: () => file, enumerable: false }) - } - if (ctx.meta == null) { - Object.defineProperty(ctx, 'meta', { get: () => file, enumerable: false }) - } - return fn(data, ctx) - } - -// patch transform/superRefine to attach ctx.meta automatically -const originalTransform = z.ZodType.prototype.transform -z.ZodType.prototype.transform = function (this: ZodTypeBase, fn: (data: any, ctx: RefinementCtx) => any) { - return originalTransform.call(this, withFileCtx(fn)) -} - -const originalSuperRefine = z.ZodType.prototype.superRefine -z.ZodType.prototype.superRefine = function (this: ZodTypeBase, fn: (data: any, ctx: RefinementCtx) => any) { - return originalSuperRefine.call(this, withFileCtx(fn)) -} - -/** - * Run safeParse with file injected. - */ -export const parseWithFile = async (schema: z.ZodType, data: unknown, file: VeliteFile) => - fileStore.run(file, () => { - const originalRun = schema._zod.run - schema._zod.run = (data, ctx) => { - const file = fileStore.getStore() - logger.info(`Running schema: ${file?.config.cache}`) - if (!('file' in data)) { - Object.defineProperty(ctx, 'file', { get: () => file, enumerable: false }) - } - if (!('meta' in data)) { - Object.defineProperty(data, 'meta', { get: () => file, enumerable: false }) - } - return originalRun.call(schema._zod, data, ctx) - } - return schema.safeParseAsync(data) - }) - -export { z } -export type Schema = z.ZodType -export type ZodType = z.ZodType -export type infer = z.infer -export * from 'zod' - -declare module 'zod' { - interface RefinementCtx { - file: VeliteFile - /** - * @deprecated Use `file` instead. - */ - meta: VeliteFile // backward-compatible alias - } -} diff --git a/zod b/zod new file mode 160000 index 00000000..6e968a3b --- /dev/null +++ b/zod @@ -0,0 +1 @@ +Subproject commit 6e968a3b49cbcb3bffc30c68634e80168e8f2a2e From 882a4da37a1c1825f2db5b71394af4916d42fbb1 Mon Sep 17 00:00:00 2001 From: zce Date: Sun, 7 Dec 2025 17:29:34 +0800 Subject: [PATCH 03/48] feat: next demo --- zod | 1 - 1 file changed, 1 deletion(-) delete mode 160000 zod diff --git a/zod b/zod deleted file mode 160000 index 6e968a3b..00000000 --- a/zod +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6e968a3b49cbcb3bffc30c68634e80168e8f2a2e From 7f49e0d64a4f70942151fd476976de053a9fd314 Mon Sep 17 00:00:00 2001 From: zce Date: Mon, 8 Dec 2025 18:56:30 +0800 Subject: [PATCH 04/48] feat: refactor file handling and parser integration - Introduced a new parser module to manage file context and configuration. - Updated VeliteFile creation to accept loaders directly. - Adjusted schema imports to utilize the new parser for accessing current file and configuration. - Enabled file nesting in VSCode settings for improved project organization. --- .vscode/settings.json | 1 + src/build.ts | 8 +++---- src/file.ts | 26 +++++++++------------- src/parser.ts | 31 ++++++++++++++++++++++++++ src/schemas/excerpt.ts | 2 +- src/schemas/file.ts | 7 +++--- src/schemas/image.ts | 7 +++--- src/schemas/index.ts | 48 ++++++++++++----------------------------- src/schemas/markdown.ts | 4 ++-- src/schemas/mdx.ts | 4 ++-- src/schemas/metadata.ts | 2 +- src/schemas/path.ts | 5 ++--- src/schemas/raw.ts | 2 +- src/schemas/slug.ts | 4 ++-- src/schemas/toc.ts | 2 +- src/schemas/unique.ts | 4 ++-- src/schemas/zod.ts | 17 --------------- 17 files changed, 80 insertions(+), 94 deletions(-) create mode 100644 src/parser.ts delete mode 100644 src/schemas/zod.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 4b9d409e..5ca266b9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,7 @@ "source.fixAll": "explicit", "source.organizeImports": "explicit" }, + "explorer.fileNesting.enabled": true, "files.exclude": { "**/node_modules": true }, diff --git a/src/build.ts b/src/build.ts index 30311987..fb63b38a 100644 --- a/src/build.ts +++ b/src/build.ts @@ -8,7 +8,7 @@ import { resolveConfig } from './config' import { VeliteFile } from './file' import { logger } from './logger' import { outputAssets, outputData, outputEntry } from './output' -import { parseWithFile } from './schemas/zod' +import { parseWithFile } from './parser' import { matchPatterns } from './utils' import type { LogLevel } from './logger' @@ -34,7 +34,7 @@ const load = async (config: Config, path: string, schema: Schema, changed?: stri if (exists) return exists } - const file = await VeliteFile.create({ path, config }) + const file = await VeliteFile.create(path, config.loaders) // may be one or more records in one file, such as yaml array or json array const isArr = Array.isArray(file.records) @@ -45,7 +45,7 @@ const load = async (config: Config, path: string, schema: Schema, changed?: stri // push index in path if file is array const pathPrefix = isArr ? [index] : [] - const result = await parseWithFile(schema, data, file) + const result = await parseWithFile(schema, data, config, file) if (result.success) return result.data @@ -53,7 +53,7 @@ const load = async (config: Config, path: string, schema: Schema, changed?: stri result.error.issues.forEach(issue => { const source = [...pathPrefix, ...(issue.path ?? [])].map(p => (typeof p === 'number' ? `[${p}]` : String(p))).join('.') const message = file.message(issue.message ?? 'Validation error', { source }) - message.fatal = (issue as any).fatal || file.config.strict === true + message.fatal = (issue as any).fatal || config.strict === true }) }) ) diff --git a/src/file.ts b/src/file.ts index eaf55daf..b6a1862e 100644 --- a/src/file.ts +++ b/src/file.ts @@ -7,22 +7,16 @@ import { VFile } from 'vfile' import type { Nodes } from 'hast' import type { Root } from 'mdast' -import type { Config } from './types' +import type { Loader } from './types' // cache loaded files for rebuild const loaded = new Map() export class VeliteFile extends VFile { - config: Config private _mdast: Root | undefined private _hast: Nodes | undefined private _plain: string | undefined - constructor({ path, config }: { path: string; config: Config }) { - super({ path }) - this.config = config - } - /** * Get parsed records from file */ @@ -81,14 +75,14 @@ export class VeliteFile extends VFile { * @param options meta options * @returns resolved meta object */ - static async create({ path, config }: { path: string; config: Config }): Promise { - const meta = new VeliteFile({ path, config }) - const loader = config.loaders.find(loader => loader.test.test(path)) - if (loader == null) return meta.fail(`no loader found for '${path}'`) - meta.value = await readFile(path) - meta.data = await loader.load(meta) - if (meta.data?.data == null) return meta.fail(`no data loaded from '${path}'`) - loaded.set(path, meta) - return meta + static async create(path: string, loaders: Loader[]): Promise { + const loader = loaders.find(l => l.test.test(path)) + const file = new VeliteFile({ path }) + if (loader == null) return file.fail(`no loader found for '${path}'`) + file.value = await readFile(path) + file.data = await loader.load(file) + if (file.data?.data == null) return file.fail(`no data loaded from '${path}'`) + loaded.set(path, file) + return file } } diff --git a/src/parser.ts b/src/parser.ts new file mode 100644 index 00000000..d0a092fe --- /dev/null +++ b/src/parser.ts @@ -0,0 +1,31 @@ +import { AsyncLocalStorage } from 'node:async_hooks' + +import type { ZodType } from 'zod' +import type { VeliteFile } from './file' +import type { Config } from './types' + +type Context = { + file: VeliteFile + config: Config +} + +const contextStore = new AsyncLocalStorage() + +export const currentFile = (): VeliteFile => { + const context = contextStore.getStore() + if (!context) throw new Error('Missing parser context') + return context.file +} + +export const currentConfig = (): Config => { + const context = contextStore.getStore() + if (!context) throw new Error('Missing parser context') + return context.config +} + +/** + * Run safeParse with file injected. + */ +export const parseWithFile = async (schema: ZodType, data: unknown, config: Config, file: VeliteFile) => { + return contextStore.run({ file, config }, () => schema.safeParseAsync(data)) +} diff --git a/src/schemas/excerpt.ts b/src/schemas/excerpt.ts index 4d49c1de..cf37992b 100644 --- a/src/schemas/excerpt.ts +++ b/src/schemas/excerpt.ts @@ -1,6 +1,6 @@ import { custom } from 'zod' -import { currentFile } from './zod' +import { currentFile } from '../parser' export interface ExcerptOptions { // /** diff --git a/src/schemas/file.ts b/src/schemas/file.ts index 4c65fdf4..d7531730 100644 --- a/src/schemas/file.ts +++ b/src/schemas/file.ts @@ -1,7 +1,7 @@ import { string } from 'zod' import { isRelativePath, processAsset } from '../assets' -import { currentFile } from './zod' +import { currentConfig, currentFile } from '../parser' export interface FileOptions { /** @@ -18,9 +18,8 @@ export const file = ({ allowNonRelativePath = true }: FileOptions = {}) => string().transform(async (value, ctx) => { try { if (allowNonRelativePath && !isRelativePath(value)) return value - const file = currentFile() - const { output } = file.config - return await processAsset(value, file.path, output.name, output.base) + const { output } = currentConfig() + return await processAsset(value, currentFile().path, output.name, output.base) } catch (err) { const message = err instanceof Error ? err.message : String(err) ctx.addIssue({ fatal: true, code: 'custom', message, continue: false }) diff --git a/src/schemas/image.ts b/src/schemas/image.ts index 44068805..e9404872 100644 --- a/src/schemas/image.ts +++ b/src/schemas/image.ts @@ -3,7 +3,7 @@ import { join } from 'node:path' import { string } from 'zod' import { getImageMetadata, processAsset } from '../assets' -import { currentFile } from './zod' +import { currentConfig, currentFile } from '../parser' import type { Image } from '../assets' @@ -43,10 +43,9 @@ export const image = ({ absoluteRoot }: ImageOptions = {}) => // return { src: value, ...metadata } // } - const file = currentFile() - const { output } = file.config // process asset as relative path - return await processAsset(value, file.path, output.name, output.base, true) + const { output } = currentConfig() + return await processAsset(value, currentFile().path, output.name, output.base, true) } catch (err) { const message = err instanceof Error ? err.message : String(err) ctx.addIssue({ fatal: true, code: 'custom', message }) diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 8e2ec6dd..b387e47c 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,34 +1,14 @@ -import * as z from 'zod' - -import { excerpt } from './excerpt' -import { file } from './file' -import { image } from './image' -import { isodate } from './isodate' -import { markdown } from './markdown' -import { mdx } from './mdx' -import { metadata } from './metadata' -import { path } from './path' -import { raw } from './raw' -import { slug } from './slug' -import { toc } from './toc' -import { unique } from './unique' -import { currentFile } from './zod' - -export const s = { - ...z, - isodate, - unique, - slug, - file, - image, - metadata, - excerpt, - markdown, - mdx, - path, - raw, - toc, - currentFile -} - -export type { infer, ZodType as Schema, ZodType } from 'zod' +export * from 'zod' +export type { Infer, ZodType as Schema, ZodType } from 'zod' +export { excerpt } from './excerpt' +export { file } from './file' +export { image } from './image' +export { isodate } from './isodate' +export { markdown } from './markdown' +export { mdx } from './mdx' +export { metadata } from './metadata' +export { path } from './path' +export { raw } from './raw' +export { slug } from './slug' +export { toc } from './toc' +export { unique } from './unique' diff --git a/src/schemas/markdown.ts b/src/schemas/markdown.ts index cee26922..611e83bd 100644 --- a/src/schemas/markdown.ts +++ b/src/schemas/markdown.ts @@ -8,7 +8,7 @@ import { visit } from 'unist-util-visit' import { custom } from 'zod' import { rehypeCopyLinkedFiles } from '../assets' -import { currentFile } from './zod' +import { currentConfig, currentFile } from '../parser' import type { Root as Hast } from 'hast' import type { Root as Mdast } from 'mdast' @@ -48,7 +48,7 @@ export const markdown = (options: MarkdownOptions = {}) => return '' } - const { markdown, output } = file.config + const { markdown, output } = currentConfig() const enableGfm = options.gfm ?? markdown?.gfm ?? true const removeComments = options.removeComments ?? markdown?.removeComments ?? true diff --git a/src/schemas/mdx.ts b/src/schemas/mdx.ts index 036be8ff..f212f383 100644 --- a/src/schemas/mdx.ts +++ b/src/schemas/mdx.ts @@ -3,7 +3,7 @@ import { visit } from 'unist-util-visit' import { custom } from 'zod' import { remarkCopyLinkedFiles } from '../assets' -import { currentFile } from './zod' +import { currentConfig, currentFile } from '../parser' import type { Root } from 'mdast' import type { PluggableList } from 'unified' @@ -27,7 +27,7 @@ export const mdx = (options: MdxOptions = {}) => return '' } - const { mdx, output } = file.config + const { mdx, output } = currentConfig() const enableGfm = options.gfm ?? mdx?.gfm ?? true const enableMinify = options.minify ?? mdx?.minify ?? true diff --git a/src/schemas/metadata.ts b/src/schemas/metadata.ts index 807e7901..e83b605d 100644 --- a/src/schemas/metadata.ts +++ b/src/schemas/metadata.ts @@ -1,6 +1,6 @@ import { custom } from 'zod' -import { currentFile } from './zod' +import { currentFile } from '../parser' // Unicode ranges for Han (Chinese) and Hiragana/Katakana (Japanese) characters const cjRanges = [ diff --git a/src/schemas/path.ts b/src/schemas/path.ts index 5bc22d02..95380dff 100644 --- a/src/schemas/path.ts +++ b/src/schemas/path.ts @@ -1,7 +1,7 @@ import { relative } from 'node:path' import { custom } from 'zod' -import { currentFile } from './zod' +import { currentConfig, currentFile } from '../parser' /** * Options for flattened path @@ -29,8 +29,7 @@ export const path = (options?: PathOptions) => ctx.addIssue({ fatal: false, code: 'custom', message: '`s.path()` schema will resolve the flattening path based on the file path' }) } - const file = currentFile() - const flattened = relative(file.config.root, file.path) + const flattened = relative(currentConfig().root, currentFile().path) .replace(/\.[^.]+$/, '') .replace(/\\/g, '/') diff --git a/src/schemas/raw.ts b/src/schemas/raw.ts index a1a40f35..990b6064 100644 --- a/src/schemas/raw.ts +++ b/src/schemas/raw.ts @@ -1,6 +1,6 @@ import { custom } from 'zod' -import { currentFile } from './zod' +import { currentFile } from '../parser' export const raw = () => custom(i => i === undefined || typeof i === 'string').transform(value => { diff --git a/src/schemas/slug.ts b/src/schemas/slug.ts index d0ad930d..df48d255 100644 --- a/src/schemas/slug.ts +++ b/src/schemas/slug.ts @@ -1,6 +1,6 @@ import { string } from 'zod' -import { currentFile } from './zod' +import { currentConfig, currentFile } from '../parser' /** * generate a slug schema @@ -16,7 +16,7 @@ export const slug = (by: string = 'global', reserved: string[] = []) => .refine(value => !reserved.includes(value), 'Reserved slug') .superRefine((value, ctx) => { const key = `schemas:slug:${by}:${value}` - const { cache } = currentFile().config + const { cache } = currentConfig() if (cache.has(key)) { ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate slug '${value}' in '${currentFile().path}'` }) } else { diff --git a/src/schemas/toc.ts b/src/schemas/toc.ts index a9e418eb..22c8225a 100644 --- a/src/schemas/toc.ts +++ b/src/schemas/toc.ts @@ -4,7 +4,7 @@ import { toc as extractToc } from 'mdast-util-toc' import { visit } from 'unist-util-visit' import { custom } from 'zod' -import { currentFile } from './zod' +import { currentFile } from '../parser' import type { Options } from 'mdast-util-toc' diff --git a/src/schemas/unique.ts b/src/schemas/unique.ts index 017405dc..bddf743c 100644 --- a/src/schemas/unique.ts +++ b/src/schemas/unique.ts @@ -1,6 +1,6 @@ import { string } from 'zod' -import { currentFile } from './zod' +import { currentConfig, currentFile } from '../parser' /** * generate a unique schema @@ -10,7 +10,7 @@ import { currentFile } from './zod' export const unique = (by: string = 'global') => string().superRefine((value, ctx) => { const key = `schemas:unique:${by}:${value}` - const { cache } = currentFile().config + const { cache } = currentConfig() if (cache.has(key)) { ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate value '${value}' in '${currentFile().path}'` }) } else { diff --git a/src/schemas/zod.ts b/src/schemas/zod.ts deleted file mode 100644 index a91e238c..00000000 --- a/src/schemas/zod.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AsyncLocalStorage } from 'node:async_hooks' - -import type { ZodType } from 'zod' -import type { VeliteFile } from '../file' - -const fileStore = new AsyncLocalStorage() - -export const currentFile = (): VeliteFile => { - const file = fileStore.getStore() - if (!file) throw new Error('Missing file context for validation') - return file -} - -/** - * Run safeParse with file injected. - */ -export const parseWithFile = async (schema: ZodType, data: unknown, file: VeliteFile) => fileStore.run(file, () => schema.safeParseAsync(data)) From 11f2012e2d530e01d2b09caf64b98304d606f49c Mon Sep 17 00:00:00 2001 From: zce Date: Mon, 15 Dec 2025 12:59:31 +0800 Subject: [PATCH 05/48] feat: refactor file handling and parser integration - Introduced a new parser module to manage file context and configuration. - Updated VeliteFile creation to accept loaders directly. - Adjusted schema imports to utilize the new parser for accessing current file and configuration. - Enabled file nesting in VSCode settings for improved project organization. --- examples/basic/velite.config.js | 6 ++--- examples/nextjs/velite.config.ts | 4 +-- examples/vite/velite.config.ts | 4 +-- src/build.ts | 9 +++---- src/config.ts | 1 - src/context.ts | 37 +++++++++++++++++++++++++ src/index.ts | 7 ++--- src/parser.ts | 31 --------------------- src/schemas/excerpt.ts | 4 +-- src/schemas/file.ts | 6 ++--- src/schemas/image.ts | 7 ++--- src/schemas/index.ts | 46 ++++++++++++++++++++++---------- src/schemas/markdown.ts | 6 ++--- src/schemas/mdx.ts | 6 ++--- src/schemas/metadata.ts | 4 +-- src/schemas/path.ts | 6 +++-- src/schemas/raw.ts | 4 +-- src/schemas/slug.ts | 19 +++---------- src/schemas/toc.ts | 4 +-- src/schemas/unique.ts | 39 +++++++++++++++++++++------ src/types.ts | 13 +++------ 21 files changed, 147 insertions(+), 116 deletions(-) create mode 100644 src/context.ts delete mode 100644 src/parser.ts diff --git a/examples/basic/velite.config.js b/examples/basic/velite.config.js index 2fb59b83..fcf7d5cb 100644 --- a/examples/basic/velite.config.js +++ b/examples/basic/velite.config.js @@ -2,7 +2,7 @@ import { exec } from 'node:child_process' import { promisify } from 'node:util' -import { defineConfig, s } from 'velite' +import { context, defineConfig, s } from 'velite' const slugify = input => input @@ -29,7 +29,7 @@ const timestamp = () => if (value != null) { addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) } - const { stdout } = await execAsync(`git log -1 --format=%cd ${s.currentFile().path}`) + const { stdout } = await execAsync(`git log -1 --format=%cd ${context().file.path}`) return new Date(stdout || Date.now()).toISOString() }) @@ -93,7 +93,7 @@ export default defineConfig({ body: s.mdx(), raw: s.raw() }) - .transform(data => ({ ...data, permalink: `/${data.slug}`, basename: s.currentFile().basename })) + .transform(data => ({ ...data, permalink: `/${data.slug}`, basename: context().file.basename })) }, posts: { name: 'Post', diff --git a/examples/nextjs/velite.config.ts b/examples/nextjs/velite.config.ts index 3eaeeea3..e6a0dca6 100644 --- a/examples/nextjs/velite.config.ts +++ b/examples/nextjs/velite.config.ts @@ -1,7 +1,7 @@ import { exec } from 'node:child_process' import { promisify } from 'node:util' import rehypePrettyCode from 'rehype-pretty-code' -import { defineCollection, defineConfig, s } from 'velite' +import { context, defineCollection, defineConfig, s } from 'velite' const slugify = (input: string) => input @@ -30,7 +30,7 @@ const timestamp = () => if (value != null) { addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) } - const { stdout } = await execAsync(`git log -1 --format=%cd ${s.currentFile().path}`) + const { stdout } = await execAsync(`git log -1 --format=%cd ${context().file.path}`) return new Date(stdout || Date.now()).toISOString() }) diff --git a/examples/vite/velite.config.ts b/examples/vite/velite.config.ts index 3eaeeea3..e6a0dca6 100644 --- a/examples/vite/velite.config.ts +++ b/examples/vite/velite.config.ts @@ -1,7 +1,7 @@ import { exec } from 'node:child_process' import { promisify } from 'node:util' import rehypePrettyCode from 'rehype-pretty-code' -import { defineCollection, defineConfig, s } from 'velite' +import { context, defineCollection, defineConfig, s } from 'velite' const slugify = (input: string) => input @@ -30,7 +30,7 @@ const timestamp = () => if (value != null) { addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) } - const { stdout } = await execAsync(`git log -1 --format=%cd ${s.currentFile().path}`) + const { stdout } = await execAsync(`git log -1 --format=%cd ${context().file.path}`) return new Date(stdout || Date.now()).toISOString() }) diff --git a/src/build.ts b/src/build.ts index fb63b38a..0e1b31e4 100644 --- a/src/build.ts +++ b/src/build.ts @@ -5,10 +5,11 @@ import { reporter } from 'vfile-reporter' import { assets } from './assets' import { resolveConfig } from './config' +import { parseWithContext } from './context' import { VeliteFile } from './file' import { logger } from './logger' import { outputAssets, outputData, outputEntry } from './output' -import { parseWithFile } from './parser' +import { uniqueCache } from './schemas/unique' import { matchPatterns } from './utils' import type { LogLevel } from './logger' @@ -45,7 +46,7 @@ const load = async (config: Config, path: string, schema: Schema, changed?: stri // push index in path if file is array const pathPrefix = isArr ? [index] : [] - const result = await parseWithFile(schema, data, config, file) + const result = await parseWithContext(schema, data, { config, file }) if (result.success) return result.data @@ -179,9 +180,7 @@ const watch = async (config: Config) => { if (!matchPatterns(filename, patterns)) return // remove changed file cache - for (const [key, value] of config.cache.entries()) { - if (value === fullpath) config.cache.delete(key) - } + uniqueCache.reset(fullpath) const begin = performance.now() logger.info(`changed: '${fullpath}', rebuilding...`) diff --git a/src/config.ts b/src/config.ts index a606de4f..80f970eb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -101,7 +101,6 @@ export const resolveConfig = async (path?: string, options: { strict?: boolean; ...loadedConfig, configPath, configImports, - cache: new Map(), root: resolve(cwd, loadedConfig.root ?? 'content'), output: { data: resolve(cwd, loadedConfig.output?.data ?? '.velite'), diff --git a/src/context.ts b/src/context.ts new file mode 100644 index 00000000..ad8261a9 --- /dev/null +++ b/src/context.ts @@ -0,0 +1,37 @@ +import { AsyncLocalStorage } from 'node:async_hooks' + +import type { VeliteFile } from './file' +import type { Schema } from './schemas' +import type { Config } from './types' + +/** + * Context in pipeline + */ +export interface Context { + /** + * Resolved config being used + */ + readonly config: Config + /** + * Current file being parsed + */ + readonly file: VeliteFile +} + +const store = new AsyncLocalStorage() + +/** + * Get current context in pipeline + */ +export const context = () => { + const ctx = store.getStore() + if (ctx) return ctx + throw new Error('Missing parser context') +} + +/** + * Run safeParse with context injected. + */ +export const parseWithContext = async (schema: Schema, data: unknown, context: Context) => { + return store.run(context, () => schema.safeParseAsync(data)) +} diff --git a/src/index.ts b/src/index.ts index 1c92b088..b4eaf8ea 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ -export * from './logger' -export * from './schemas' export * from './assets' export * from './build' -export * from './types' +export * from './context' export * from './file' +export * from './logger' +export * from './schemas' +export * from './types' diff --git a/src/parser.ts b/src/parser.ts deleted file mode 100644 index d0a092fe..00000000 --- a/src/parser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { AsyncLocalStorage } from 'node:async_hooks' - -import type { ZodType } from 'zod' -import type { VeliteFile } from './file' -import type { Config } from './types' - -type Context = { - file: VeliteFile - config: Config -} - -const contextStore = new AsyncLocalStorage() - -export const currentFile = (): VeliteFile => { - const context = contextStore.getStore() - if (!context) throw new Error('Missing parser context') - return context.file -} - -export const currentConfig = (): Config => { - const context = contextStore.getStore() - if (!context) throw new Error('Missing parser context') - return context.config -} - -/** - * Run safeParse with file injected. - */ -export const parseWithFile = async (schema: ZodType, data: unknown, config: Config, file: VeliteFile) => { - return contextStore.run({ file, config }, () => schema.safeParseAsync(data)) -} diff --git a/src/schemas/excerpt.ts b/src/schemas/excerpt.ts index cf37992b..6b89d606 100644 --- a/src/schemas/excerpt.ts +++ b/src/schemas/excerpt.ts @@ -1,6 +1,6 @@ import { custom } from 'zod' -import { currentFile } from '../parser' +import { context } from '../context' export interface ExcerptOptions { // /** @@ -19,7 +19,7 @@ export interface ExcerptOptions { export const excerpt = ({ length = 260 }: ExcerptOptions = {}) => custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - value = value ?? currentFile().plain + value = value ?? context().file.plain if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' diff --git a/src/schemas/file.ts b/src/schemas/file.ts index d7531730..128c2af7 100644 --- a/src/schemas/file.ts +++ b/src/schemas/file.ts @@ -1,7 +1,7 @@ import { string } from 'zod' import { isRelativePath, processAsset } from '../assets' -import { currentConfig, currentFile } from '../parser' +import { context } from '../context' export interface FileOptions { /** @@ -18,8 +18,8 @@ export const file = ({ allowNonRelativePath = true }: FileOptions = {}) => string().transform(async (value, ctx) => { try { if (allowNonRelativePath && !isRelativePath(value)) return value - const { output } = currentConfig() - return await processAsset(value, currentFile().path, output.name, output.base) + const { file, config } = context() + return await processAsset(value, file.path, config.output.name, config.output.base) } catch (err) { const message = err instanceof Error ? err.message : String(err) ctx.addIssue({ fatal: true, code: 'custom', message, continue: false }) diff --git a/src/schemas/image.ts b/src/schemas/image.ts index e9404872..c9c77f9c 100644 --- a/src/schemas/image.ts +++ b/src/schemas/image.ts @@ -3,7 +3,7 @@ import { join } from 'node:path' import { string } from 'zod' import { getImageMetadata, processAsset } from '../assets' -import { currentConfig, currentFile } from '../parser' +import { context } from '../context' import type { Image } from '../assets' @@ -43,9 +43,10 @@ export const image = ({ absoluteRoot }: ImageOptions = {}) => // return { src: value, ...metadata } // } + const { file, config } = context() + // process asset as relative path - const { output } = currentConfig() - return await processAsset(value, currentFile().path, output.name, output.base, true) + return await processAsset(value, file.path, config.output.name, config.output.base, true) } catch (err) { const message = err instanceof Error ? err.message : String(err) ctx.addIssue({ fatal: true, code: 'custom', message }) diff --git a/src/schemas/index.ts b/src/schemas/index.ts index b387e47c..9964e27c 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,14 +1,32 @@ -export * from 'zod' -export type { Infer, ZodType as Schema, ZodType } from 'zod' -export { excerpt } from './excerpt' -export { file } from './file' -export { image } from './image' -export { isodate } from './isodate' -export { markdown } from './markdown' -export { mdx } from './mdx' -export { metadata } from './metadata' -export { path } from './path' -export { raw } from './raw' -export { slug } from './slug' -export { toc } from './toc' -export { unique } from './unique' +import * as z from 'zod' + +import { excerpt } from './excerpt' +import { file } from './file' +import { image } from './image' +import { isodate } from './isodate' +import { markdown } from './markdown' +import { mdx } from './mdx' +import { metadata } from './metadata' +import { path } from './path' +import { raw } from './raw' +import { slug } from './slug' +import { toc } from './toc' +import { unique } from './unique' + +export const s = { + ...z, + excerpt, + file, + image, + isodate, + markdown, + mdx, + metadata, + path, + raw, + slug, + toc, + unique +} as const + +export type Schema = z.ZodType diff --git a/src/schemas/markdown.ts b/src/schemas/markdown.ts index 611e83bd..42d18a2a 100644 --- a/src/schemas/markdown.ts +++ b/src/schemas/markdown.ts @@ -8,7 +8,7 @@ import { visit } from 'unist-util-visit' import { custom } from 'zod' import { rehypeCopyLinkedFiles } from '../assets' -import { currentConfig, currentFile } from '../parser' +import { context } from '../context' import type { Root as Hast } from 'hast' import type { Root as Mdast } from 'mdast' @@ -41,14 +41,14 @@ const rehypeMetaString = () => (tree: Hast) => { export const markdown = (options: MarkdownOptions = {}) => custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - const file = currentFile() + const { file, config } = context() value = value ?? file.content if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' } - const { markdown, output } = currentConfig() + const { markdown, output } = config const enableGfm = options.gfm ?? markdown?.gfm ?? true const removeComments = options.removeComments ?? markdown?.removeComments ?? true diff --git a/src/schemas/mdx.ts b/src/schemas/mdx.ts index f212f383..7ac7f586 100644 --- a/src/schemas/mdx.ts +++ b/src/schemas/mdx.ts @@ -3,7 +3,7 @@ import { visit } from 'unist-util-visit' import { custom } from 'zod' import { remarkCopyLinkedFiles } from '../assets' -import { currentConfig, currentFile } from '../parser' +import { context } from '../context' import type { Root } from 'mdast' import type { PluggableList } from 'unified' @@ -20,14 +20,14 @@ const remarkRemoveComments = () => (tree: Root) => { export const mdx = (options: MdxOptions = {}) => custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - const file = currentFile() + const { file, config } = context() value = value ?? file.content if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return '' } - const { mdx, output } = currentConfig() + const { mdx, output } = config const enableGfm = options.gfm ?? mdx?.gfm ?? true const enableMinify = options.minify ?? mdx?.minify ?? true diff --git a/src/schemas/metadata.ts b/src/schemas/metadata.ts index e83b605d..a3480b23 100644 --- a/src/schemas/metadata.ts +++ b/src/schemas/metadata.ts @@ -1,6 +1,6 @@ import { custom } from 'zod' -import { currentFile } from '../parser' +import { context } from '../context' // Unicode ranges for Han (Chinese) and Hiragana/Katakana (Japanese) characters const cjRanges = [ @@ -63,7 +63,7 @@ export interface Metadata { export const metadata = () => custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - value = value ?? currentFile().plain + value = value ?? context().file.plain if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) return { readingTime: 0, wordCount: 0 } diff --git a/src/schemas/path.ts b/src/schemas/path.ts index 95380dff..0c08fe0e 100644 --- a/src/schemas/path.ts +++ b/src/schemas/path.ts @@ -1,7 +1,7 @@ import { relative } from 'node:path' import { custom } from 'zod' -import { currentConfig, currentFile } from '../parser' +import { context } from '../context' /** * Options for flattened path @@ -29,7 +29,9 @@ export const path = (options?: PathOptions) => ctx.addIssue({ fatal: false, code: 'custom', message: '`s.path()` schema will resolve the flattening path based on the file path' }) } - const flattened = relative(currentConfig().root, currentFile().path) + const { config, file } = context() + + const flattened = relative(config.root, file.path) .replace(/\.[^.]+$/, '') .replace(/\\/g, '/') diff --git a/src/schemas/raw.ts b/src/schemas/raw.ts index 990b6064..142d5f6f 100644 --- a/src/schemas/raw.ts +++ b/src/schemas/raw.ts @@ -1,8 +1,8 @@ import { custom } from 'zod' -import { currentFile } from '../parser' +import { context } from '../context' export const raw = () => custom(i => i === undefined || typeof i === 'string').transform(value => { - return value ?? currentFile().content ?? '' + return value ?? context().file.content ?? '' }) diff --git a/src/schemas/slug.ts b/src/schemas/slug.ts index df48d255..b4b9e310 100644 --- a/src/schemas/slug.ts +++ b/src/schemas/slug.ts @@ -1,25 +1,14 @@ -import { string } from 'zod' - -import { currentConfig, currentFile } from '../parser' +import { unique } from './unique' /** * generate a slug schema - * @param by unique by this, used to create a unique set of slugs + * @param group unique by this, used to create a unique set of slugs * @param reserved reserved slugs, will be rejected * @returns slug schema */ -export const slug = (by: string = 'global', reserved: string[] = []) => - string() +export const slug = (group: string = 'global', reserved: string[] = []) => + unique(`slug:${group}`) .min(3) .max(200) .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/i, 'Invalid slug') .refine(value => !reserved.includes(value), 'Reserved slug') - .superRefine((value, ctx) => { - const key = `schemas:slug:${by}:${value}` - const { cache } = currentConfig() - if (cache.has(key)) { - ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate slug '${value}' in '${currentFile().path}'` }) - } else { - cache.set(key, currentFile().path) - } - }) diff --git a/src/schemas/toc.ts b/src/schemas/toc.ts index 22c8225a..c91a4762 100644 --- a/src/schemas/toc.ts +++ b/src/schemas/toc.ts @@ -4,7 +4,7 @@ import { toc as extractToc } from 'mdast-util-toc' import { visit } from 'unist-util-visit' import { custom } from 'zod' -import { currentFile } from '../parser' +import { context } from '../context' import type { Options } from 'mdast-util-toc' @@ -101,7 +101,7 @@ const parse = (tree?: List): TocEntry[] => { export const toc = (options?: T) => custom(i => i === undefined || typeof i === 'string').transform( async (value, ctx) => { - const file = currentFile() + const { file } = context() value = value ?? file.content if (value == null || value.length === 0) { ctx.addIssue({ code: 'custom', message: 'The content is empty' }) diff --git a/src/schemas/unique.ts b/src/schemas/unique.ts index bddf743c..0d53853a 100644 --- a/src/schemas/unique.ts +++ b/src/schemas/unique.ts @@ -1,19 +1,42 @@ import { string } from 'zod' -import { currentConfig, currentFile } from '../parser' +import { context } from '../context' + +class UniqueCache { + private readonly store = new Map() + + set(group: string, value: string, path: string) { + this.store.set(`${group}:${value}`, path) + } + + get(group: string, value: string) { + return this.store.get(`${group}:${value}`) + } + + reset(path?: string) { + if (path == null) { + this.store.clear() + return + } + for (const [key, value] of this.store.entries()) { + if (value === path) this.store.delete(key) + } + } +} + +export const uniqueCache = new UniqueCache() /** * generate a unique schema - * @param by unique by + * @param group unique by * @returns unique schema */ -export const unique = (by: string = 'global') => +export const unique = (group: string = 'global') => string().superRefine((value, ctx) => { - const key = `schemas:unique:${by}:${value}` - const { cache } = currentConfig() - if (cache.has(key)) { - ctx.addIssue({ fatal: true, code: 'custom', message: `duplicate value '${value}' in '${currentFile().path}'` }) + const conflict = uniqueCache.get(group, value) + if (conflict) { + ctx.addIssue({ fatal: true, code: 'custom', message: `Duplicate '${value}': already exists in '${conflict}'` }) } else { - cache.set(key, currentFile().path) + uniqueCache.set(group, value, context().file.path) } }) diff --git a/src/types.ts b/src/types.ts index dc7e254f..721ddbc6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -206,7 +206,7 @@ export type Result = { [P in keyof T]: CollectionType extends Partial * return false to prevent the default output to a file if you wanted * @param data loaded data */ - prepare?: (data: Result, context: Context) => Promisable + prepare?: (data: Result, context: HookContext) => Promisable /** * Build success hook * @description * You can do anything after the build is complete, such as print some tips or deploy the output files. * @param data loaded data */ - complete?: (data: Result, context: Context) => Promisable + complete?: (data: Result, context: HookContext) => Promisable } /** @@ -289,13 +289,6 @@ export interface Config extends Readonly { * Dependencies of the config file */ readonly configImports: string[] - /** - * Global cache (need refresh in rebuild) - * memory level cache is enough for Velite. and it's easy & efficient. - * maybe we can use other cache way in the future if needed. - * but for now, we just need a simple cache. - */ - readonly cache: Map /** * The root directory of the contents (relative to config file). */ From ad3f1d6fb184c6ada6e78c014807a7c5c7e06208 Mon Sep 17 00:00:00 2001 From: zce Date: Mon, 15 Dec 2025 13:17:55 +0800 Subject: [PATCH 06/48] feat: refactor file handling and parser integration - Introduced a new parser module to manage file context and configuration. - Updated VeliteFile creation to accept loaders directly. - Adjusted schema imports to utilize the new parser for accessing current file and configuration. - Enabled file nesting in VSCode settings for improved project organization. --- examples/basic/velite.config.js | 6 +-- package.json | 6 +-- pnpm-lock.yaml | 80 +++++++++++++++++++-------------- src/build.ts | 1 + src/schemas/unique.ts | 10 ++--- test/basic.ts | 8 ++-- 6 files changed, 62 insertions(+), 49 deletions(-) diff --git a/examples/basic/velite.config.js b/examples/basic/velite.config.js index fcf7d5cb..cc873b7c 100644 --- a/examples/basic/velite.config.js +++ b/examples/basic/velite.config.js @@ -63,7 +63,7 @@ export default defineConfig({ schema: s .object({ name: s.unique('categories'), - slug: s.slug('global'), + slug: s.slug(), cover: s.image().optional(), description: s.string().max(999).optional(), count @@ -76,7 +76,7 @@ export default defineConfig({ schema: s .object({ name: s.string().max(20), - slug: s.slug('global'), + slug: s.slug(), cover: s.image().optional(), description: s.string().max(999).optional(), count @@ -89,7 +89,7 @@ export default defineConfig({ schema: s .object({ title: s.string().max(99), - slug: s.slug('global'), + slug: s.slug(), body: s.mdx(), raw: s.raw() }) diff --git a/package.json b/package.json index 4c649334..a0a576e5 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ }, "dependencies": { "@mdx-js/mdx": "^3.1.1", - "esbuild": "^0.25.12", + "esbuild": "^0.27.1", "sharp": "^0.34.5", "terser": "^5.44.1", "zod": "^4.1.13" @@ -67,9 +67,9 @@ "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@types/hast": "^3.0.4", "@types/mdast": "^4.0.4", - "@types/node": "^22.19.1", + "@types/node": "^25.0.2", "@types/picomatch": "^4.0.2", - "chokidar": "^4.0.3", + "chokidar": "^5.0.0", "fast-glob": "^3.3.3", "hast-util-raw": "^9.1.0", "hast-util-to-string": "^3.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a32de1bd..30e87782 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^3.1.1 version: 3.1.1 esbuild: - specifier: ^0.25.12 - version: 0.25.12 + specifier: ^0.27.1 + version: 0.27.1 sharp: specifier: ^0.34.5 version: 0.34.5 @@ -34,14 +34,14 @@ importers: specifier: ^4.0.4 version: 4.0.4 '@types/node': - specifier: ^22.19.1 - version: 22.19.1 + specifier: ^25.0.2 + version: 25.0.2 '@types/picomatch': specifier: ^4.0.2 version: 4.0.2 chokidar: - specifier: ^4.0.3 - version: 4.0.3 + specifier: ^5.0.0 + version: 5.0.0 fast-glob: specifier: ^3.3.3 version: 3.3.3 @@ -116,7 +116,7 @@ importers: devDependencies: vitepress: specifier: latest - version: 1.6.4(@algolia/client-search@5.20.0)(@types/node@24.3.0)(lightningcss@1.30.1)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3) + version: 1.6.4(@algolia/client-search@5.20.0)(@types/node@25.0.2)(lightningcss@1.30.1)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3) examples/basic: devDependencies: @@ -195,7 +195,7 @@ importers: version: link:../../packages/vite '@vitejs/plugin-react': specifier: ^5.0.1 - version: 5.0.1(vite@7.1.3(@types/node@24.3.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) + version: 5.0.1(vite@7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) eslint: specifier: ^9.34.0 version: 9.34.0(jiti@2.5.1) @@ -225,7 +225,7 @@ importers: version: link:../.. vite: specifier: ^7.1.3 - version: 7.1.3(@types/node@24.3.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + version: 7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) packages/vite: dependencies: @@ -234,7 +234,7 @@ importers: version: link:../.. vite: specifier: ^5.0.0 || ^6.0.0 || ^7.0.0 - version: 7.1.3(@types/node@24.3.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + version: 7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) packages: @@ -1699,12 +1699,12 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} - '@types/node@22.19.1': - resolution: {integrity: sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==} - '@types/node@24.3.0': resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==} + '@types/node@25.0.2': + resolution: {integrity: sha512-gWEkeiyYE4vqjON/+Obqcoeffmk0NF15WSBwSs7zwVA2bAbTaE0SJ7P0WNGoJn8uE7fiaV5a7dKYIJriEqOrmA==} + '@types/picomatch@4.0.2': resolution: {integrity: sha512-qHHxQ+P9PysNEGbALT8f8YOSHW0KJu6l2xU8DYY0fu/EmGxXdVnuTLvFUvBgPJMSqXq29SYHveejeAha+4AYgA==} @@ -2012,6 +2012,10 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + chownr@3.0.0: resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} engines: {node: '>=18'} @@ -3026,6 +3030,10 @@ packages: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} + readdirp@5.0.0: + resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==} + engines: {node: '>= 20.19.0'} + recma-build-jsx@1.0.0: resolution: {integrity: sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew==} @@ -3372,12 +3380,12 @@ packages: ufo@1.6.1: resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} - undici-types@6.21.0: - resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} - undici-types@7.10.0: resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} + undici-types@7.16.0: + resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + unified@11.0.5: resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} @@ -4732,14 +4740,14 @@ snapshots: '@types/ms@2.1.0': {} - '@types/node@22.19.1': - dependencies: - undici-types: 6.21.0 - '@types/node@24.3.0': dependencies: undici-types: 7.10.0 + '@types/node@25.0.2': + dependencies: + undici-types: 7.16.0 + '@types/picomatch@4.0.2': {} '@types/react-dom@19.1.7(@types/react@19.1.11)': @@ -4863,7 +4871,7 @@ snapshots: '@ungap/structured-clone@1.3.0': {} - '@vitejs/plugin-react@5.0.1(vite@7.1.3(@types/node@24.3.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': + '@vitejs/plugin-react@5.0.1(vite@7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': dependencies: '@babel/core': 7.28.3 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.3) @@ -4871,13 +4879,13 @@ snapshots: '@rolldown/pluginutils': 1.0.0-beta.32 '@types/babel__core': 7.20.5 react-refresh: 0.17.0 - vite: 7.1.3(@types/node@24.3.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + vite: 7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@5.2.1(vite@5.4.14(@types/node@24.3.0)(lightningcss@1.30.1)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3))': + '@vitejs/plugin-vue@5.2.1(vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3))': dependencies: - vite: 5.4.14(@types/node@24.3.0)(lightningcss@1.30.1)(terser@5.44.1) + vite: 5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1) vue: 3.5.13(typescript@5.9.3) '@vue/compiler-core@3.5.13': @@ -5084,6 +5092,10 @@ snapshots: dependencies: readdirp: 4.1.2 + chokidar@5.0.0: + dependencies: + readdirp: 5.0.0 + chownr@3.0.0: {} cli-cursor@5.0.0: @@ -6447,6 +6459,8 @@ snapshots: readdirp@4.1.2: {} + readdirp@5.0.0: {} + recma-build-jsx@1.0.0: dependencies: '@types/estree': 1.0.8 @@ -6943,10 +6957,10 @@ snapshots: ufo@1.6.1: {} - undici-types@6.21.0: {} - undici-types@7.10.0: {} + undici-types@7.16.0: {} + unified@11.0.5: dependencies: '@types/unist': 3.0.3 @@ -7032,18 +7046,18 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite@5.4.14(@types/node@24.3.0)(lightningcss@1.30.1)(terser@5.44.1): + vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1): dependencies: esbuild: 0.21.5 postcss: 8.5.6 rollup: 4.41.0 optionalDependencies: - '@types/node': 24.3.0 + '@types/node': 25.0.2 fsevents: 2.3.3 lightningcss: 1.30.1 terser: 5.44.1 - vite@7.1.3(@types/node@24.3.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): + vite@7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): dependencies: esbuild: 0.25.12 fdir: 6.5.0(picomatch@4.0.3) @@ -7052,7 +7066,7 @@ snapshots: rollup: 4.48.1 tinyglobby: 0.2.14 optionalDependencies: - '@types/node': 24.3.0 + '@types/node': 25.0.2 fsevents: 2.3.3 jiti: 2.5.1 lightningcss: 1.30.1 @@ -7060,7 +7074,7 @@ snapshots: tsx: 4.21.0 yaml: 2.8.2 - vitepress@1.6.4(@algolia/client-search@5.20.0)(@types/node@24.3.0)(lightningcss@1.30.1)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3): + vitepress@1.6.4(@algolia/client-search@5.20.0)(@types/node@25.0.2)(lightningcss@1.30.1)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3): dependencies: '@docsearch/css': 3.8.2 '@docsearch/js': 3.8.2(@algolia/client-search@5.20.0)(search-insights@2.17.3) @@ -7069,7 +7083,7 @@ snapshots: '@shikijs/transformers': 2.1.0 '@shikijs/types': 2.5.0 '@types/markdown-it': 14.1.2 - '@vitejs/plugin-vue': 5.2.1(vite@5.4.14(@types/node@24.3.0)(lightningcss@1.30.1)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3)) + '@vitejs/plugin-vue': 5.2.1(vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3)) '@vue/devtools-api': 7.7.0 '@vue/shared': 3.5.13 '@vueuse/core': 12.5.0(typescript@5.9.3) @@ -7078,7 +7092,7 @@ snapshots: mark.js: 8.11.1 minisearch: 7.1.1 shiki: 2.5.0 - vite: 5.4.14(@types/node@24.3.0)(lightningcss@1.30.1)(terser@5.44.1) + vite: 5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1) vue: 3.5.13(typescript@5.9.3) optionalDependencies: postcss: 8.5.6 diff --git a/src/build.ts b/src/build.ts index 0e1b31e4..86828697 100644 --- a/src/build.ts +++ b/src/build.ts @@ -173,6 +173,7 @@ const watch = async (config: Config) => { if (configImports.includes(fullpath)) { logger.info('velite config changed, restarting...') watcher.close() + uniqueCache.reset() return build({ config: config.configPath, clean: false, watch: true }) } diff --git a/src/schemas/unique.ts b/src/schemas/unique.ts index 0d53853a..4c05464c 100644 --- a/src/schemas/unique.ts +++ b/src/schemas/unique.ts @@ -14,10 +14,8 @@ class UniqueCache { } reset(path?: string) { - if (path == null) { - this.store.clear() - return - } + if (path == null) return this.store.clear() + for (const [key, value] of this.store.entries()) { if (value === path) this.store.delete(key) } @@ -32,10 +30,10 @@ export const uniqueCache = new UniqueCache() * @returns unique schema */ export const unique = (group: string = 'global') => - string().superRefine((value, ctx) => { + string().superRefine(async (value, ctx) => { const conflict = uniqueCache.get(group, value) if (conflict) { - ctx.addIssue({ fatal: true, code: 'custom', message: `Duplicate '${value}': already exists in '${conflict}'` }) + ctx.addIssue({ fatal: true, code: 'custom', message: `Duplicate '${value}' with '${conflict}'` }) } else { uniqueCache.set(group, value, context().file.path) } diff --git a/test/basic.ts b/test/basic.ts index 0d2e60f6..1e51bdd7 100644 --- a/test/basic.ts +++ b/test/basic.ts @@ -1,12 +1,12 @@ import { equal } from 'node:assert' +// import from source +import { exec } from 'node:child_process' import { readFile, rm } from 'node:fs/promises' import { test } from 'node:test' -// import from source -import { build } from '../src' - test('standalone fixtures', async t => { - await build({ config: 'examples/basic/velite.config.js' }) + // will use velite dist + await new Promise((res, rej) => exec('npm run build', { cwd: 'examples/basic' }, (e, s) => (e ? rej(e) : res(s)))) const entry = await readFile('examples/basic/.velite/index.js', 'utf8') equal(entry.length, 398, 'entry output length should be 398') From 468f391528f492726979cbed9f4c3d5470059528 Mon Sep 17 00:00:00 2001 From: zce Date: Mon, 15 Dec 2025 13:54:09 +0800 Subject: [PATCH 07/48] feat: refactor file handling and parser integration - Introduced a new parser module to manage file context and configuration. - Updated VeliteFile creation to accept loaders directly. - Adjusted schema imports to utilize the new parser for accessing current file and configuration. - Enabled file nesting in VSCode settings for improved project organization. --- examples/nextjs/next.config.ts | 5 +- examples/nextjs/package.json | 18 +- examples/vite/package.json | 28 +- pnpm-lock.yaml | 1152 ++++++++++++++++---------------- 4 files changed, 604 insertions(+), 599 deletions(-) diff --git a/examples/nextjs/next.config.ts b/examples/nextjs/next.config.ts index 193e2579..28b67948 100644 --- a/examples/nextjs/next.config.ts +++ b/examples/nextjs/next.config.ts @@ -1,8 +1,9 @@ import type { NextConfig } from 'next' -const isDev = process.argv.indexOf('dev') !== -1 +const isDev = process.env.NODE_ENV === 'development' const isBuild = process.argv.indexOf('build') !== -1 -if (!process.env.VELITE_STARTED && (isDev || isBuild)) { +const isTypegen = process.argv.indexOf('typegen') !== -1 +if (!process.env.VELITE_STARTED && (isDev || isBuild || isTypegen)) { process.env.VELITE_STARTED = '1' import('velite').then(m => m.build({ watch: isDev, clean: !isDev })) } diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index 8bba9f0f..fb9ef42c 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -10,20 +10,20 @@ "content": "velite --clean" }, "dependencies": { - "@tailwindcss/postcss": "^4.1.12", - "@tailwindcss/typography": "^0.5.16", - "@types/node": "^24.3.0", + "@tailwindcss/postcss": "^4.1.18", + "@tailwindcss/typography": "^0.5.19", + "@types/node": "^25.0.2", "@types/react": "19.2.7", "@types/react-dom": "19.2.3", - "next": "16.0.7", + "next": "16.0.10", "next-themes": "^0.4.6", "postcss": "^8.5.6", - "react": "19.2.1", - "react-dom": "19.2.1", + "react": "19.2.3", + "react-dom": "19.2.3", "rehype-pretty-code": "^0.14.1", - "shiki": "^3.11.0", - "tailwindcss": "^4.1.12", - "typescript": "^5.9.2", + "shiki": "^3.20.0", + "tailwindcss": "^4.1.18", + "typescript": "^5.9.3", "velite": "workspace:*" } } diff --git a/examples/vite/package.json b/examples/vite/package.json index 99e68538..8dcfaa30 100644 --- a/examples/vite/package.json +++ b/examples/vite/package.json @@ -10,24 +10,24 @@ "preview": "vite preview" }, "dependencies": { - "react": "^19.1.1", - "react-dom": "^19.1.1" + "react": "^19.2.3", + "react-dom": "^19.2.3" }, "devDependencies": { - "@eslint/js": "^9.34.0", - "@types/react": "^19.1.11", - "@types/react-dom": "^19.1.7", + "@eslint/js": "^9.39.2", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", "@velite/plugin-vite": "workspace:*", - "@vitejs/plugin-react": "^5.0.1", - "eslint": "^9.34.0", - "eslint-plugin-react-hooks": "^5.2.0", - "eslint-plugin-react-refresh": "^0.4.20", - "globals": "^16.3.0", + "@vitejs/plugin-react": "^5.1.2", + "eslint": "^9.39.2", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.25", + "globals": "^16.5.0", "rehype-pretty-code": "^0.14.1", - "shiki": "^3.11.0", - "typescript": "^5.9.2", - "typescript-eslint": "^8.40.0", + "shiki": "^3.20.0", + "typescript": "^5.9.3", + "typescript-eslint": "^8.49.0", "velite": "workspace:*", - "vite": "^7.1.3" + "vite": "^7.2.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30e87782..1ac83a7d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -89,7 +89,7 @@ importers: version: 2.13.1 tsup: specifier: ^8.5.1 - version: 8.5.1(jiti@2.5.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.2) + version: 8.5.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.2) tsx: specifier: ^4.21.0 version: 4.21.0 @@ -116,7 +116,7 @@ importers: devDependencies: vitepress: specifier: latest - version: 1.6.4(@algolia/client-search@5.20.0)(@types/node@25.0.2)(lightningcss@1.30.1)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3) + version: 1.6.4(@algolia/client-search@5.20.0)(@types/node@25.0.2)(lightningcss@1.30.2)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3) examples/basic: devDependencies: @@ -127,14 +127,14 @@ importers: examples/nextjs: dependencies: '@tailwindcss/postcss': - specifier: ^4.1.12 - version: 4.1.12 + specifier: ^4.1.18 + version: 4.1.18 '@tailwindcss/typography': - specifier: ^0.5.16 - version: 0.5.16(tailwindcss@4.1.12) + specifier: ^0.5.19 + version: 0.5.19(tailwindcss@4.1.18) '@types/node': - specifier: ^24.3.0 - version: 24.3.0 + specifier: ^25.0.2 + version: 25.0.2 '@types/react': specifier: 19.2.7 version: 19.2.7 @@ -142,32 +142,32 @@ importers: specifier: 19.2.3 version: 19.2.3(@types/react@19.2.7) next: - specifier: 16.0.7 - version: 16.0.7(react-dom@19.2.1(react@19.2.1))(react@19.2.1) + specifier: 16.0.10 + version: 16.0.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3) next-themes: specifier: ^0.4.6 - version: 0.4.6(react-dom@19.2.1(react@19.2.1))(react@19.2.1) + version: 0.4.6(react-dom@19.2.3(react@19.2.3))(react@19.2.3) postcss: specifier: ^8.5.6 version: 8.5.6 react: - specifier: 19.2.1 - version: 19.2.1 + specifier: 19.2.3 + version: 19.2.3 react-dom: - specifier: 19.2.1 - version: 19.2.1(react@19.2.1) + specifier: 19.2.3 + version: 19.2.3(react@19.2.3) rehype-pretty-code: specifier: ^0.14.1 - version: 0.14.1(shiki@3.11.0) + version: 0.14.1(shiki@3.20.0) shiki: - specifier: ^3.11.0 - version: 3.11.0 + specifier: ^3.20.0 + version: 3.20.0 tailwindcss: - specifier: ^4.1.12 - version: 4.1.12 + specifier: ^4.1.18 + version: 4.1.18 typescript: - specifier: ^5.9.2 - version: 5.9.2 + specifier: ^5.9.3 + version: 5.9.3 velite: specifier: workspace:* version: link:../.. @@ -175,57 +175,57 @@ importers: examples/vite: dependencies: react: - specifier: ^19.1.1 - version: 19.1.1 + specifier: ^19.2.3 + version: 19.2.3 react-dom: - specifier: ^19.1.1 - version: 19.1.1(react@19.1.1) + specifier: ^19.2.3 + version: 19.2.3(react@19.2.3) devDependencies: '@eslint/js': - specifier: ^9.34.0 - version: 9.34.0 + specifier: ^9.39.2 + version: 9.39.2 '@types/react': - specifier: ^19.1.11 - version: 19.1.11 + specifier: ^19.2.7 + version: 19.2.7 '@types/react-dom': - specifier: ^19.1.7 - version: 19.1.7(@types/react@19.1.11) + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.7) '@velite/plugin-vite': specifier: workspace:* version: link:../../packages/vite '@vitejs/plugin-react': - specifier: ^5.0.1 - version: 5.0.1(vite@7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) + specifier: ^5.1.2 + version: 5.1.2(vite@7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) eslint: - specifier: ^9.34.0 - version: 9.34.0(jiti@2.5.1) + specifier: ^9.39.2 + version: 9.39.2(jiti@2.6.1) eslint-plugin-react-hooks: - specifier: ^5.2.0 - version: 5.2.0(eslint@9.34.0(jiti@2.5.1)) + specifier: ^7.0.1 + version: 7.0.1(eslint@9.39.2(jiti@2.6.1)) eslint-plugin-react-refresh: - specifier: ^0.4.20 - version: 0.4.20(eslint@9.34.0(jiti@2.5.1)) + specifier: ^0.4.25 + version: 0.4.25(eslint@9.39.2(jiti@2.6.1)) globals: - specifier: ^16.3.0 - version: 16.3.0 + specifier: ^16.5.0 + version: 16.5.0 rehype-pretty-code: specifier: ^0.14.1 - version: 0.14.1(shiki@3.11.0) + version: 0.14.1(shiki@3.20.0) shiki: - specifier: ^3.11.0 - version: 3.11.0 + specifier: ^3.20.0 + version: 3.20.0 typescript: - specifier: ^5.9.2 - version: 5.9.2 + specifier: ^5.9.3 + version: 5.9.3 typescript-eslint: - specifier: ^8.40.0 - version: 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) + specifier: ^8.49.0 + version: 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) velite: specifier: workspace:* version: link:../.. vite: - specifier: ^7.1.3 - version: 7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + specifier: ^7.2.7 + version: 7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) packages/vite: dependencies: @@ -234,7 +234,7 @@ importers: version: link:../.. vite: specifier: ^5.0.0 || ^6.0.0 || ^7.0.0 - version: 7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + version: 7.1.3(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) packages: @@ -330,6 +330,10 @@ packages: resolution: {integrity: sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==} engines: {node: '>=6.9.0'} + '@babel/core@7.28.5': + resolution: {integrity: sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==} + engines: {node: '>=6.9.0'} + '@babel/generator@7.28.5': resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==} engines: {node: '>=6.9.0'} @@ -372,6 +376,10 @@ packages: resolution: {integrity: sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==} engines: {node: '>=6.9.0'} + '@babel/helpers@7.28.4': + resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==} + engines: {node: '>=6.9.0'} + '@babel/parser@7.28.5': resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==} engines: {node: '>=6.0.0'} @@ -883,36 +891,42 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + '@eslint-community/eslint-utils@4.9.0': + resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + '@eslint-community/regexpp@4.12.1': resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.21.0': - resolution: {integrity: sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==} + '@eslint/config-array@0.21.1': + resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/config-helpers@0.3.1': - resolution: {integrity: sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==} + '@eslint/config-helpers@0.4.2': + resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.15.2': - resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==} + '@eslint/core@0.17.0': + resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/eslintrc@3.3.1': resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.34.0': - resolution: {integrity: sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==} + '@eslint/js@9.39.2': + resolution: {integrity: sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/object-schema@2.1.6': - resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} + '@eslint/object-schema@2.1.7': + resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.3.5': - resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==} + '@eslint/plugin-kit@0.4.1': + resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@humanfs/core@0.19.1': @@ -1096,10 +1110,6 @@ packages: cpu: [x64] os: [win32] - '@isaacs/fs-minipass@4.0.1': - resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} - engines: {node: '>=18.0.0'} - '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -1125,53 +1135,53 @@ packages: '@mdx-js/mdx@3.1.1': resolution: {integrity: sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==} - '@next/env@16.0.7': - resolution: {integrity: sha512-gpaNgUh5nftFKRkRQGnVi5dpcYSKGcZZkQffZ172OrG/XkrnS7UBTQ648YY+8ME92cC4IojpI2LqTC8sTDhAaw==} + '@next/env@16.0.10': + resolution: {integrity: sha512-8tuaQkyDVgeONQ1MeT9Mkk8pQmZapMKFh5B+OrFUlG3rVmYTXcXlBetBgTurKXGaIZvkoqRT9JL5K3phXcgang==} - '@next/swc-darwin-arm64@16.0.7': - resolution: {integrity: sha512-LlDtCYOEj/rfSnEn/Idi+j1QKHxY9BJFmxx7108A6D8K0SB+bNgfYQATPk/4LqOl4C0Wo3LACg2ie6s7xqMpJg==} + '@next/swc-darwin-arm64@16.0.10': + resolution: {integrity: sha512-4XgdKtdVsaflErz+B5XeG0T5PeXKDdruDf3CRpnhN+8UebNa5N2H58+3GDgpn/9GBurrQ1uWW768FfscwYkJRg==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@next/swc-darwin-x64@16.0.7': - resolution: {integrity: sha512-rtZ7BhnVvO1ICf3QzfW9H3aPz7GhBrnSIMZyr4Qy6boXF0b5E3QLs+cvJmg3PsTCG2M1PBoC+DANUi4wCOKXpA==} + '@next/swc-darwin-x64@16.0.10': + resolution: {integrity: sha512-spbEObMvRKkQ3CkYVOME+ocPDFo5UqHb8EMTS78/0mQ+O1nqE8toHJVioZo4TvebATxgA8XMTHHrScPrn68OGw==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@next/swc-linux-arm64-gnu@16.0.7': - resolution: {integrity: sha512-mloD5WcPIeIeeZqAIP5c2kdaTa6StwP4/2EGy1mUw8HiexSHGK/jcM7lFuS3u3i2zn+xH9+wXJs6njO7VrAqww==} + '@next/swc-linux-arm64-gnu@16.0.10': + resolution: {integrity: sha512-uQtWE3X0iGB8apTIskOMi2w/MKONrPOUCi5yLO+v3O8Mb5c7K4Q5KD1jvTpTF5gJKa3VH/ijKjKUq9O9UhwOYw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@16.0.7': - resolution: {integrity: sha512-+ksWNrZrthisXuo9gd1XnjHRowCbMtl/YgMpbRvFeDEqEBd523YHPWpBuDjomod88U8Xliw5DHhekBC3EOOd9g==} + '@next/swc-linux-arm64-musl@16.0.10': + resolution: {integrity: sha512-llA+hiDTrYvyWI21Z0L1GiXwjQaanPVQQwru5peOgtooeJ8qx3tlqRV2P7uH2pKQaUfHxI/WVarvI5oYgGxaTw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-x64-gnu@16.0.7': - resolution: {integrity: sha512-4WtJU5cRDxpEE44Ana2Xro1284hnyVpBb62lIpU5k85D8xXxatT+rXxBgPkc7C1XwkZMWpK5rXLXTh9PFipWsA==} + '@next/swc-linux-x64-gnu@16.0.10': + resolution: {integrity: sha512-AK2q5H0+a9nsXbeZ3FZdMtbtu9jxW4R/NgzZ6+lrTm3d6Zb7jYrWcgjcpM1k8uuqlSy4xIyPR2YiuUr+wXsavA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@16.0.7': - resolution: {integrity: sha512-HYlhqIP6kBPXalW2dbMTSuB4+8fe+j9juyxwfMwCe9kQPPeiyFn7NMjNfoFOfJ2eXkeQsoUGXg+O2SE3m4Qg2w==} + '@next/swc-linux-x64-musl@16.0.10': + resolution: {integrity: sha512-1TDG9PDKivNw5550S111gsO4RGennLVl9cipPhtkXIFVwo31YZ73nEbLjNC8qG3SgTz/QZyYyaFYMeY4BKZR/g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-win32-arm64-msvc@16.0.7': - resolution: {integrity: sha512-EviG+43iOoBRZg9deGauXExjRphhuYmIOJ12b9sAPy0eQ6iwcPxfED2asb/s2/yiLYOdm37kPaiZu8uXSYPs0Q==} + '@next/swc-win32-arm64-msvc@16.0.10': + resolution: {integrity: sha512-aEZIS4Hh32xdJQbHz121pyuVZniSNoqDVx1yIr2hy+ZwJGipeqnMZBJHyMxv2tiuAXGx6/xpTcQJ6btIiBjgmg==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@next/swc-win32-x64-msvc@16.0.7': - resolution: {integrity: sha512-gniPjy55zp5Eg0896qSrf3yB1dw4F/3s8VK1ephdsZZ129j2n6e1WqCbE2YgcKhW9hPB9TVZENugquWJD5x0ug==} + '@next/swc-win32-x64-msvc@16.0.10': + resolution: {integrity: sha512-E+njfCoFLb01RAFEnGZn6ERoOqhK1Gl3Lfz1Kjnj0Ulfu7oJbuMyvBKNj/bw8XZnenHDASlygTjZICQW+rYW1Q==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1188,8 +1198,8 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@rolldown/pluginutils@1.0.0-beta.32': - resolution: {integrity: sha512-QReCdvxiUZAPkvp1xpAg62IeNzykOFA6syH2CnClif4YmALN1XKpB39XneL80008UbtMShthSVDKmrx05N1q/g==} + '@rolldown/pluginutils@1.0.0-beta.53': + resolution: {integrity: sha512-vENRlFU4YbrwVqNDZ7fLvy+JR1CRkyr01jhSiDpE1u6py3OMzQfztQU2jxykW3ALNxO4kSlqIDeYyD0Y9RcQeQ==} '@rollup/rollup-android-arm-eabi@4.41.0': resolution: {integrity: sha512-KxN+zCjOYHGwCl4UCtSfZ6jrq/qi88JDUtiEFk8LELEHq2Egfc/FgW+jItZiOLRuQfb/3xJSgFuNPC9jzggX+A==} @@ -1507,8 +1517,8 @@ packages: '@shikijs/core@2.5.0': resolution: {integrity: sha512-uu/8RExTKtavlpH7XqnVYBrfBkUc20ngXiX9NSrBhOVZYv/7XQRKUyhtkeflY5QsxC0GbJThCerruZfsUaSldg==} - '@shikijs/core@3.11.0': - resolution: {integrity: sha512-oJwU+DxGqp6lUZpvtQgVOXNZcVsirN76tihOLBmwILkKuRuwHteApP8oTXmL4tF5vS5FbOY0+8seXmiCoslk4g==} + '@shikijs/core@3.20.0': + resolution: {integrity: sha512-f2ED7HYV4JEk827mtMDwe/yQ25pRiXZmtHjWF8uzZKuKiEsJR7Ce1nuQ+HhV9FzDcbIo4ObBCD9GPTzNuy9S1g==} '@shikijs/engine-javascript@2.1.0': resolution: {integrity: sha512-cgIUdAliOsoaa0rJz/z+jvhrpRd+fVAoixVFEVxUq5FA+tHgBZAIfVJSgJNVRj2hs/wZ1+4hMe82eKAThVh0nQ==} @@ -1516,8 +1526,8 @@ packages: '@shikijs/engine-javascript@2.5.0': resolution: {integrity: sha512-VjnOpnQf8WuCEZtNUdjjwGUbtAVKuZkVQ/5cHy/tojVVRIRtlWMYVjyWhxOmIq05AlSOv72z7hRNRGVBgQOl0w==} - '@shikijs/engine-javascript@3.11.0': - resolution: {integrity: sha512-6/ov6pxrSvew13k9ztIOnSBOytXeKs5kfIR7vbhdtVRg+KPzvp2HctYGeWkqv7V6YIoLicnig/QF3iajqyElZA==} + '@shikijs/engine-javascript@3.20.0': + resolution: {integrity: sha512-OFx8fHAZuk7I42Z9YAdZ95To6jDePQ9Rnfbw9uSRTSbBhYBp1kEOKv/3jOimcj3VRUKusDYM6DswLauwfhboLg==} '@shikijs/engine-oniguruma@2.1.0': resolution: {integrity: sha512-Ujik33wEDqgqY2WpjRDUBECGcKPv3eGGkoXPujIXvokLaRmGky8NisSk8lHUGeSFxo/Cz5sgFej9sJmA9yeepg==} @@ -1525,20 +1535,20 @@ packages: '@shikijs/engine-oniguruma@2.5.0': resolution: {integrity: sha512-pGd1wRATzbo/uatrCIILlAdFVKdxImWJGQ5rFiB5VZi2ve5xj3Ax9jny8QvkaV93btQEwR/rSz5ERFpC5mKNIw==} - '@shikijs/engine-oniguruma@3.11.0': - resolution: {integrity: sha512-4DwIjIgETK04VneKbfOE4WNm4Q7WC1wo95wv82PoHKdqX4/9qLRUwrfKlmhf0gAuvT6GHy0uc7t9cailk6Tbhw==} + '@shikijs/engine-oniguruma@3.20.0': + resolution: {integrity: sha512-Yx3gy7xLzM0ZOjqoxciHjA7dAt5tyzJE3L4uQoM83agahy+PlW244XJSrmJRSBvGYELDhYXPacD4R/cauV5bzQ==} '@shikijs/langs@2.5.0': resolution: {integrity: sha512-Qfrrt5OsNH5R+5tJ/3uYBBZv3SuGmnRPejV9IlIbFH3HTGLDlkqgHymAlzklVmKBjAaVmkPkyikAV/sQ1wSL+w==} - '@shikijs/langs@3.11.0': - resolution: {integrity: sha512-Njg/nFL4HDcf/ObxcK2VeyidIq61EeLmocrwTHGGpOQx0BzrPWM1j55XtKQ1LvvDWH15cjQy7rg96aJ1/l63uw==} + '@shikijs/langs@3.20.0': + resolution: {integrity: sha512-le+bssCxcSHrygCWuOrYJHvjus6zhQ2K7q/0mgjiffRbkhM4o1EWu2m+29l0yEsHDbWaWPNnDUTRVVBvBBeKaA==} '@shikijs/themes@2.5.0': resolution: {integrity: sha512-wGrk+R8tJnO0VMzmUExHR+QdSaPUl/NKs+a4cQQRWyoc3YFbUzuLEi/KWK1hj+8BfHRKm2jNhhJck1dfstJpiw==} - '@shikijs/themes@3.11.0': - resolution: {integrity: sha512-BhhWRzCTEk2CtWt4S4bgsOqPJRkapvxdsifAwqP+6mk5uxboAQchc0etiJ0iIasxnMsb764qGD24DK9albcU9Q==} + '@shikijs/themes@3.20.0': + resolution: {integrity: sha512-U1NSU7Sl26Q7ErRvJUouArxfM2euWqq1xaSrbqMu2iqa+tSp0D1Yah8216sDYbdDHw4C8b75UpE65eWorm2erQ==} '@shikijs/transformers@2.1.0': resolution: {integrity: sha512-3sfvh6OKUVkT5wZFU1xxiq1qqNIuCwUY3yOb9ZGm19y80UZ/eoroLE2orGNzfivyTxR93GfXXZC/ghPR0/SBow==} @@ -1549,8 +1559,8 @@ packages: '@shikijs/types@2.5.0': resolution: {integrity: sha512-ygl5yhxki9ZLNuNpPitBWvcy9fsSKKaRuO4BAlMyagszQidxcpLAr0qiW/q43DtSIDxO6hEbtYLiFZNXO/hdGw==} - '@shikijs/types@3.11.0': - resolution: {integrity: sha512-RB7IMo2E7NZHyfkqAuaf4CofyY8bPzjWPjJRzn6SEak3b46fIQyG6Vx5fG/obqkfppQ+g8vEsiD7Uc6lqQt32Q==} + '@shikijs/types@3.20.0': + resolution: {integrity: sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw==} '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} @@ -1558,65 +1568,65 @@ packages: '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} - '@tailwindcss/node@4.1.12': - resolution: {integrity: sha512-3hm9brwvQkZFe++SBt+oLjo4OLDtkvlE8q2WalaD/7QWaeM7KEJbAiY/LJZUaCs7Xa8aUu4xy3uoyX4q54UVdQ==} + '@tailwindcss/node@4.1.18': + resolution: {integrity: sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ==} - '@tailwindcss/oxide-android-arm64@4.1.12': - resolution: {integrity: sha512-oNY5pq+1gc4T6QVTsZKwZaGpBb2N1H1fsc1GD4o7yinFySqIuRZ2E4NvGasWc6PhYJwGK2+5YT1f9Tp80zUQZQ==} + '@tailwindcss/oxide-android-arm64@4.1.18': + resolution: {integrity: sha512-dJHz7+Ugr9U/diKJA0W6N/6/cjI+ZTAoxPf9Iz9BFRF2GzEX8IvXxFIi/dZBloVJX/MZGvRuFA9rqwdiIEZQ0Q==} engines: {node: '>= 10'} cpu: [arm64] os: [android] - '@tailwindcss/oxide-darwin-arm64@4.1.12': - resolution: {integrity: sha512-cq1qmq2HEtDV9HvZlTtrj671mCdGB93bVY6J29mwCyaMYCP/JaUBXxrQQQm7Qn33AXXASPUb2HFZlWiiHWFytw==} + '@tailwindcss/oxide-darwin-arm64@4.1.18': + resolution: {integrity: sha512-Gc2q4Qhs660bhjyBSKgq6BYvwDz4G+BuyJ5H1xfhmDR3D8HnHCmT/BSkvSL0vQLy/nkMLY20PQ2OoYMO15Jd0A==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@tailwindcss/oxide-darwin-x64@4.1.12': - resolution: {integrity: sha512-6UCsIeFUcBfpangqlXay9Ffty9XhFH1QuUFn0WV83W8lGdX8cD5/+2ONLluALJD5+yJ7k8mVtwy3zMZmzEfbLg==} + '@tailwindcss/oxide-darwin-x64@4.1.18': + resolution: {integrity: sha512-FL5oxr2xQsFrc3X9o1fjHKBYBMD1QZNyc1Xzw/h5Qu4XnEBi3dZn96HcHm41c/euGV+GRiXFfh2hUCyKi/e+yw==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@tailwindcss/oxide-freebsd-x64@4.1.12': - resolution: {integrity: sha512-JOH/f7j6+nYXIrHobRYCtoArJdMJh5zy5lr0FV0Qu47MID/vqJAY3r/OElPzx1C/wdT1uS7cPq+xdYYelny1ww==} + '@tailwindcss/oxide-freebsd-x64@4.1.18': + resolution: {integrity: sha512-Fj+RHgu5bDodmV1dM9yAxlfJwkkWvLiRjbhuO2LEtwtlYlBgiAT4x/j5wQr1tC3SANAgD+0YcmWVrj8R9trVMA==} engines: {node: '>= 10'} cpu: [x64] os: [freebsd] - '@tailwindcss/oxide-linux-arm-gnueabihf@4.1.12': - resolution: {integrity: sha512-v4Ghvi9AU1SYgGr3/j38PD8PEe6bRfTnNSUE3YCMIRrrNigCFtHZ2TCm8142X8fcSqHBZBceDx+JlFJEfNg5zQ==} + '@tailwindcss/oxide-linux-arm-gnueabihf@4.1.18': + resolution: {integrity: sha512-Fp+Wzk/Ws4dZn+LV2Nqx3IilnhH51YZoRaYHQsVq3RQvEl+71VGKFpkfHrLM/Li+kt5c0DJe/bHXK1eHgDmdiA==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - '@tailwindcss/oxide-linux-arm64-gnu@4.1.12': - resolution: {integrity: sha512-YP5s1LmetL9UsvVAKusHSyPlzSRqYyRB0f+Kl/xcYQSPLEw/BvGfxzbH+ihUciePDjiXwHh+p+qbSP3SlJw+6g==} + '@tailwindcss/oxide-linux-arm64-gnu@4.1.18': + resolution: {integrity: sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@tailwindcss/oxide-linux-arm64-musl@4.1.12': - resolution: {integrity: sha512-V8pAM3s8gsrXcCv6kCHSuwyb/gPsd863iT+v1PGXC4fSL/OJqsKhfK//v8P+w9ThKIoqNbEnsZqNy+WDnwQqCA==} + '@tailwindcss/oxide-linux-arm64-musl@4.1.18': + resolution: {integrity: sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@tailwindcss/oxide-linux-x64-gnu@4.1.12': - resolution: {integrity: sha512-xYfqYLjvm2UQ3TZggTGrwxjYaLB62b1Wiysw/YE3Yqbh86sOMoTn0feF98PonP7LtjsWOWcXEbGqDL7zv0uW8Q==} + '@tailwindcss/oxide-linux-x64-gnu@4.1.18': + resolution: {integrity: sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@tailwindcss/oxide-linux-x64-musl@4.1.12': - resolution: {integrity: sha512-ha0pHPamN+fWZY7GCzz5rKunlv9L5R8kdh+YNvP5awe3LtuXb5nRi/H27GeL2U+TdhDOptU7T6Is7mdwh5Ar3A==} + '@tailwindcss/oxide-linux-x64-musl@4.1.18': + resolution: {integrity: sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@tailwindcss/oxide-wasm32-wasi@4.1.12': - resolution: {integrity: sha512-4tSyu3dW+ktzdEpuk6g49KdEangu3eCYoqPhWNsZgUhyegEda3M9rG0/j1GV/JjVVsj+lG7jWAyrTlLzd/WEBg==} + '@tailwindcss/oxide-wasm32-wasi@4.1.18': + resolution: {integrity: sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==} engines: {node: '>=14.0.0'} cpu: [wasm32] bundledDependencies: @@ -1627,27 +1637,27 @@ packages: - '@emnapi/wasi-threads' - tslib - '@tailwindcss/oxide-win32-arm64-msvc@4.1.12': - resolution: {integrity: sha512-iGLyD/cVP724+FGtMWslhcFyg4xyYyM+5F4hGvKA7eifPkXHRAUDFaimu53fpNg9X8dfP75pXx/zFt/jlNF+lg==} + '@tailwindcss/oxide-win32-arm64-msvc@4.1.18': + resolution: {integrity: sha512-HjSA7mr9HmC8fu6bdsZvZ+dhjyGCLdotjVOgLA2vEqxEBZaQo9YTX4kwgEvPCpRh8o4uWc4J/wEoFzhEmjvPbA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@tailwindcss/oxide-win32-x64-msvc@4.1.12': - resolution: {integrity: sha512-NKIh5rzw6CpEodv/++r0hGLlfgT/gFN+5WNdZtvh6wpU2BpGNgdjvj6H2oFc8nCM839QM1YOhjpgbAONUb4IxA==} + '@tailwindcss/oxide-win32-x64-msvc@4.1.18': + resolution: {integrity: sha512-bJWbyYpUlqamC8dpR7pfjA0I7vdF6t5VpUGMWRkXVE3AXgIZjYUYAK7II1GNaxR8J1SSrSrppRar8G++JekE3Q==} engines: {node: '>= 10'} cpu: [x64] os: [win32] - '@tailwindcss/oxide@4.1.12': - resolution: {integrity: sha512-gM5EoKHW/ukmlEtphNwaGx45fGoEmP10v51t9unv55voWh6WrOL19hfuIdo2FjxIaZzw776/BUQg7Pck++cIVw==} + '@tailwindcss/oxide@4.1.18': + resolution: {integrity: sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A==} engines: {node: '>= 10'} - '@tailwindcss/postcss@4.1.12': - resolution: {integrity: sha512-5PpLYhCAwf9SJEeIsSmCDLgyVfdBhdBpzX1OJ87anT9IVR0Z9pjM0FNixCAUAHGnMBGB8K99SwAheXrT0Kh6QQ==} + '@tailwindcss/postcss@4.1.18': + resolution: {integrity: sha512-Ce0GFnzAOuPyfV5SxjXGn0CubwGcuDB0zcdaPuCSzAa/2vII24JTkH+I6jcbXLb1ctjZMZZI6OjDaLPJQL1S0g==} - '@tailwindcss/typography@0.5.16': - resolution: {integrity: sha512-0wDLwCVF5V3x3b1SGXPCDcdsbDHMBe+lkFzBRaHeLvNi+nrrnZ1lA18u+OTWO8iSWU2GxUOCvlXtDuqftc1oiA==} + '@tailwindcss/typography@0.5.19': + resolution: {integrity: sha512-w31dd8HOx3k9vPtcQh5QHP9GwKcgbMp87j58qi6xgiBnFFtKEAgCWnDw4qUT8aHwkCp8bKvb/KGKWWHedP0AAg==} peerDependencies: tailwindcss: '>=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1' @@ -1699,28 +1709,17 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} - '@types/node@24.3.0': - resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==} - '@types/node@25.0.2': resolution: {integrity: sha512-gWEkeiyYE4vqjON/+Obqcoeffmk0NF15WSBwSs7zwVA2bAbTaE0SJ7P0WNGoJn8uE7fiaV5a7dKYIJriEqOrmA==} '@types/picomatch@4.0.2': resolution: {integrity: sha512-qHHxQ+P9PysNEGbALT8f8YOSHW0KJu6l2xU8DYY0fu/EmGxXdVnuTLvFUvBgPJMSqXq29SYHveejeAha+4AYgA==} - '@types/react-dom@19.1.7': - resolution: {integrity: sha512-i5ZzwYpqjmrKenzkoLM2Ibzt6mAsM7pxB6BCIouEVVmgiqaMj1TjaK7hnA36hbW5aZv20kx7Lw6hWzPWg0Rurw==} - peerDependencies: - '@types/react': ^19.0.0 - '@types/react-dom@19.2.3': resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==} peerDependencies: '@types/react': ^19.2.0 - '@types/react@19.1.11': - resolution: {integrity: sha512-lr3jdBw/BGj49Eps7EvqlUaoeA0xpj3pc0RoJkHpYaCHkVK7i28dKyImLQb3JVlqs3aYSXf7qYuWOW/fgZnTXQ==} - '@types/react@19.2.7': resolution: {integrity: sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==} @@ -1739,70 +1738,70 @@ packages: '@types/web-bluetooth@0.0.20': resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} - '@typescript-eslint/eslint-plugin@8.40.0': - resolution: {integrity: sha512-w/EboPlBwnmOBtRbiOvzjD+wdiZdgFeo17lkltrtn7X37vagKKWJABvyfsJXTlHe6XBzugmYgd4A4nW+k8Mixw==} + '@typescript-eslint/eslint-plugin@8.49.0': + resolution: {integrity: sha512-JXij0vzIaTtCwu6SxTh8qBc66kmf1xs7pI4UOiMDFVct6q86G0Zs7KRcEoJgY3Cav3x5Tq0MF5jwgpgLqgKG3A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.40.0 + '@typescript-eslint/parser': ^8.49.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/parser@8.40.0': - resolution: {integrity: sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw==} + '@typescript-eslint/parser@8.49.0': + resolution: {integrity: sha512-N9lBGA9o9aqb1hVMc9hzySbhKibHmB+N3IpoShyV6HyQYRGIhlrO5rQgttypi+yEeKsKI4idxC8Jw6gXKD4THA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/project-service@8.40.0': - resolution: {integrity: sha512-/A89vz7Wf5DEXsGVvcGdYKbVM9F7DyFXj52lNYUDS1L9yJfqjW/fIp5PgMuEJL/KeqVTe2QSbXAGUZljDUpArw==} + '@typescript-eslint/project-service@8.49.0': + resolution: {integrity: sha512-/wJN0/DKkmRUMXjZUXYZpD1NEQzQAAn9QWfGwo+Ai8gnzqH7tvqS7oNVdTjKqOcPyVIdZdyCMoqN66Ia789e7g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/scope-manager@8.40.0': - resolution: {integrity: sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w==} + '@typescript-eslint/scope-manager@8.49.0': + resolution: {integrity: sha512-npgS3zi+/30KSOkXNs0LQXtsg9ekZ8OISAOLGWA/ZOEn0ZH74Ginfl7foziV8DT+D98WfQ5Kopwqb/PZOaIJGg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/tsconfig-utils@8.40.0': - resolution: {integrity: sha512-jtMytmUaG9d/9kqSl/W3E3xaWESo4hFDxAIHGVW/WKKtQhesnRIJSAJO6XckluuJ6KDB5woD1EiqknriCtAmcw==} + '@typescript-eslint/tsconfig-utils@8.49.0': + resolution: {integrity: sha512-8prixNi1/6nawsRYxet4YOhnbW+W9FK/bQPxsGB1D3ZrDzbJ5FXw5XmzxZv82X3B+ZccuSxo/X8q9nQ+mFecWA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/type-utils@8.40.0': - resolution: {integrity: sha512-eE60cK4KzAc6ZrzlJnflXdrMqOBaugeukWICO2rB0KNvwdIMaEaYiywwHMzA1qFpTxrLhN9Lp4E/00EgWcD3Ow==} + '@typescript-eslint/type-utils@8.49.0': + resolution: {integrity: sha512-KTExJfQ+svY8I10P4HdxKzWsvtVnsuCifU5MvXrRwoP2KOlNZ9ADNEWWsQTJgMxLzS5VLQKDjkCT/YzgsnqmZg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/types@8.40.0': - resolution: {integrity: sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==} + '@typescript-eslint/types@8.49.0': + resolution: {integrity: sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.40.0': - resolution: {integrity: sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ==} + '@typescript-eslint/typescript-estree@8.49.0': + resolution: {integrity: sha512-jrLdRuAbPfPIdYNppHJ/D0wN+wwNfJ32YTAm10eJVsFmrVpXQnDWBn8niCSMlWjvml8jsce5E/O+86IQtTbJWA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/utils@8.40.0': - resolution: {integrity: sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg==} + '@typescript-eslint/utils@8.49.0': + resolution: {integrity: sha512-N3W7rJw7Rw+z1tRsHZbK395TWSYvufBXumYtEGzypgMUthlg0/hmCImeA8hgO2d2G4pd7ftpxxul2J8OdtdaFA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/visitor-keys@8.40.0': - resolution: {integrity: sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==} + '@typescript-eslint/visitor-keys@8.49.0': + resolution: {integrity: sha512-LlKaciDe3GmZFphXIc79THF/YYBugZ7FS1pO581E/edlVVNbZKDy93evqmrfQ9/Y4uN0vVhX4iuchq26mK/iiA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} - '@vitejs/plugin-react@5.0.1': - resolution: {integrity: sha512-DE4UNaBXwtVoDJ0ccBdLVjFTWL70NRuWNCxEieTI3lrq9ORB9aOCQEKstwDXBl87NvFdbqh/p7eINGyj0BthJA==} + '@vitejs/plugin-react@5.1.2': + resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 @@ -2016,10 +2015,6 @@ packages: resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} engines: {node: '>= 20.19.0'} - chownr@3.0.0: - resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} - engines: {node: '>=18'} - cli-cursor@5.0.0: resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} engines: {node: '>=18'} @@ -2090,15 +2085,6 @@ packages: csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} - debug@4.4.1: - resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -2186,14 +2172,14 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} - eslint-plugin-react-hooks@5.2.0: - resolution: {integrity: sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==} - engines: {node: '>=10'} + eslint-plugin-react-hooks@7.0.1: + resolution: {integrity: sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==} + engines: {node: '>=18'} peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 - eslint-plugin-react-refresh@0.4.20: - resolution: {integrity: sha512-XpbHQ2q5gUF8BGOX4dHe+71qoirYMhApEPZ7sfhF/dNnOF1UXnCMGZf79SFTBO7Bz5YEIT4TMieSlJBWhP9WBA==} + eslint-plugin-react-refresh@0.4.25: + resolution: {integrity: sha512-dRUD2LOdEqI4zXHqbQ442blQAzdSuShAaiSq5Vtyy6LT08YUf0oOjBDo4VPx0dCPgiPWh1WB4dtbLOd0kOlDPQ==} peerDependencies: eslint: '>=8.40' @@ -2209,8 +2195,8 @@ packages: resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.34.0: - resolution: {integrity: sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==} + eslint@9.39.2: + resolution: {integrity: sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -2350,16 +2336,13 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globals@16.3.0: - resolution: {integrity: sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ==} + globals@16.5.0: + resolution: {integrity: sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==} engines: {node: '>=18'} graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -2397,6 +2380,12 @@ packages: hastscript@9.0.1: resolution: {integrity: sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==} + hermes-estree@0.25.1: + resolution: {integrity: sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==} + + hermes-parser@0.25.1: + resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==} + hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -2461,8 +2450,8 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - jiti@2.5.1: - resolution: {integrity: sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==} + jiti@2.6.1: + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true joycon@3.1.1: @@ -2502,68 +2491,74 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - lightningcss-darwin-arm64@1.30.1: - resolution: {integrity: sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ==} + lightningcss-android-arm64@1.30.2: + resolution: {integrity: sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.30.2: + resolution: {integrity: sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [darwin] - lightningcss-darwin-x64@1.30.1: - resolution: {integrity: sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA==} + lightningcss-darwin-x64@1.30.2: + resolution: {integrity: sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [darwin] - lightningcss-freebsd-x64@1.30.1: - resolution: {integrity: sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig==} + lightningcss-freebsd-x64@1.30.2: + resolution: {integrity: sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [freebsd] - lightningcss-linux-arm-gnueabihf@1.30.1: - resolution: {integrity: sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q==} + lightningcss-linux-arm-gnueabihf@1.30.2: + resolution: {integrity: sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA==} engines: {node: '>= 12.0.0'} cpu: [arm] os: [linux] - lightningcss-linux-arm64-gnu@1.30.1: - resolution: {integrity: sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw==} + lightningcss-linux-arm64-gnu@1.30.2: + resolution: {integrity: sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - lightningcss-linux-arm64-musl@1.30.1: - resolution: {integrity: sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==} + lightningcss-linux-arm64-musl@1.30.2: + resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - lightningcss-linux-x64-gnu@1.30.1: - resolution: {integrity: sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==} + lightningcss-linux-x64-gnu@1.30.2: + resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - lightningcss-linux-x64-musl@1.30.1: - resolution: {integrity: sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==} + lightningcss-linux-x64-musl@1.30.2: + resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - lightningcss-win32-arm64-msvc@1.30.1: - resolution: {integrity: sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==} + lightningcss-win32-arm64-msvc@1.30.2: + resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [win32] - lightningcss-win32-x64-msvc@1.30.1: - resolution: {integrity: sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg==} + lightningcss-win32-x64-msvc@1.30.2: + resolution: {integrity: sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [win32] - lightningcss@1.30.1: - resolution: {integrity: sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==} + lightningcss@1.30.2: + resolution: {integrity: sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==} engines: {node: '>= 12.0.0'} lilconfig@3.1.3: @@ -2590,12 +2585,6 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} - lodash.castarray@4.4.0: - resolution: {integrity: sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==} - - lodash.isplainobject@4.0.6: - resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} - lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} @@ -2800,25 +2789,12 @@ packages: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} - minipass@7.1.2: - resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} - engines: {node: '>=16 || 14 >=14.17'} - minisearch@7.1.1: resolution: {integrity: sha512-b3YZEYCEH4EdCAtYP7OlDyx7FdPwNzuNwLQ34SfJpM9dlbBZzeXndGavTrC+VCiRWomL21SWfMc6SCKO/U2ZNw==} - minizlib@3.0.2: - resolution: {integrity: sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==} - engines: {node: '>= 18'} - mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} - mkdirp@3.0.1: - resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==} - engines: {node: '>=10'} - hasBin: true - mlly@1.8.0: resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==} @@ -2846,8 +2822,8 @@ packages: react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc - next@16.0.7: - resolution: {integrity: sha512-3mBRJyPxT4LOxAJI6IsXeFtKfiJUbjCLgvXO02fV8Wy/lIhPvP94Fe7dGhUgHXcQy4sSuYwQNcOLhIfOm0rL0A==} + next@16.0.10: + resolution: {integrity: sha512-RtWh5PUgI+vxlV3HdR+IfWA1UUHu0+Ram/JBO4vWB54cVPentCD0e+lxyAYEsDTqGGMg7qpjhKh6dc6aW7W/sA==} engines: {node: '>=20.9.0'} hasBin: true peerDependencies: @@ -2887,8 +2863,8 @@ packages: oniguruma-to-es@3.1.1: resolution: {integrity: sha512-bUH8SDvPkH3ho3dvwJwfonjlQ4R80vjyvrU8YpxuROddv55vAEJrTuCuCVUhhsHbtlD9tGGbaNApGQckXhS8iQ==} - oniguruma-to-es@4.3.3: - resolution: {integrity: sha512-rPiZhzC3wXwE59YQMRDodUwwT9FZ9nNBwQQfsd1wfdtlKEyCdRV0avrTcSZ5xlIvGRVPd/cx6ZN45ECmS39xvg==} + oniguruma-to-es@4.3.4: + resolution: {integrity: sha512-3VhUGN3w2eYxnTzHn+ikMI+fp/96KoRSVK9/kMTcFqj1NRDh2IhQCKvYxDnWePKRXY/AqH+Fuiyb7VHSzBjHfA==} optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} @@ -3004,26 +2980,17 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - react-dom@19.1.1: - resolution: {integrity: sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==} - peerDependencies: - react: ^19.1.1 - - react-dom@19.2.1: - resolution: {integrity: sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==} + react-dom@19.2.3: + resolution: {integrity: sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==} peerDependencies: - react: ^19.2.1 - - react-refresh@0.17.0: - resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==} - engines: {node: '>=0.10.0'} + react: ^19.2.3 - react@19.1.1: - resolution: {integrity: sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==} + react-refresh@0.18.0: + resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==} engines: {node: '>=0.10.0'} - react@19.2.1: - resolution: {integrity: sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==} + react@19.2.3: + resolution: {integrity: sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==} engines: {node: '>=0.10.0'} readdirp@4.1.2: @@ -3136,9 +3103,6 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - scheduler@0.26.0: - resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==} - scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} @@ -3169,8 +3133,8 @@ packages: shiki@2.5.0: resolution: {integrity: sha512-mI//trrsaiCIPsja5CNfsyNOqgAZUb6VpJA+340toL42UpzQlXpwRV9nch69X6gaUxrr9kaOOa6e3y3uAkGFxQ==} - shiki@3.11.0: - resolution: {integrity: sha512-VgKumh/ib38I1i3QkMn6mAQA6XjjQubqaAYhfge71glAll0/4xnt8L2oSuC45Qcr/G5Kbskj4RliMQddGmy/Og==} + shiki@3.20.0: + resolution: {integrity: sha512-kgCOlsnyWb+p0WU+01RjkCH+eBVsjL1jOwUYWv0YDWkM2/A46+LDKVs5yZCUXjJG6bj4ndFoAg5iLIIue6dulg==} signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -3272,17 +3236,13 @@ packages: tabbable@6.2.0: resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} - tailwindcss@4.1.12: - resolution: {integrity: sha512-DzFtxOi+7NsFf7DBtI3BJsynR+0Yp6etH+nRPTbpWnS2pZBaSksv/JGctNwSWzbFjp0vxSqknaUylseZqMDGrA==} + tailwindcss@4.1.18: + resolution: {integrity: sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==} tapable@2.2.2: resolution: {integrity: sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==} engines: {node: '>=6'} - tar@7.4.3: - resolution: {integrity: sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==} - engines: {node: '>=18'} - terser@5.44.1: resolution: {integrity: sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==} engines: {node: '>=10'} @@ -3360,18 +3320,13 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - typescript-eslint@8.40.0: - resolution: {integrity: sha512-Xvd2l+ZmFDPEt4oj1QEXzA4A2uUK6opvKu3eGN9aGjB8au02lIVcLyi375w94hHyejTOmzIU77L8ol2sRg9n7Q==} + typescript-eslint@8.49.0: + resolution: {integrity: sha512-zRSVH1WXD0uXczCXw+nsdjGPUdx4dfrs5VQoHnUWmv1U3oNlAKv4FUNdLDhVUg+gYn+a5hUESqch//Rv5wVhrg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' - typescript@5.9.2: - resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} - engines: {node: '>=14.17'} - hasBin: true - typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -3380,9 +3335,6 @@ packages: ufo@1.6.1: resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} - undici-types@7.10.0: - resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} - undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} @@ -3508,6 +3460,46 @@ packages: yaml: optional: true + vite@7.2.7: + resolution: {integrity: sha512-ITcnkFeR3+fI8P1wMgItjGrR10170d8auB4EpMLPqmx6uxElH3a/hHGQabSHKdqd4FXWO1nFIp9rRn7JQ34ACQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + vitepress@1.6.4: resolution: {integrity: sha512-+2ym1/+0VVrbhNyRoFFesVvBvHAVMZMK0rw60E3X/5349M1GuVdKeazuksqopEdvkKwKGs21Q729jX81/bkBJg==} hasBin: true @@ -3547,10 +3539,6 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - yallist@5.0.0: - resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} - engines: {node: '>=18'} - yaml@2.8.2: resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==} engines: {node: '>= 14.6'} @@ -3560,6 +3548,12 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zod-validation-error@4.0.2: + resolution: {integrity: sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==} + engines: {node: '>=18.0.0'} + peerDependencies: + zod: ^3.25.0 || ^4.0.0 + zod@4.1.13: resolution: {integrity: sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==} @@ -3701,7 +3695,27 @@ snapshots: '@babel/traverse': 7.28.5 '@babel/types': 7.28.5 convert-source-map: 2.0.0 - debug: 4.4.1 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/core@7.28.5': + dependencies: + '@babel/code-frame': 7.27.1 + '@babel/generator': 7.28.5 + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) + '@babel/helpers': 7.28.4 + '@babel/parser': 7.28.5 + '@babel/template': 7.27.2 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -3742,6 +3756,15 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5)': + dependencies: + '@babel/core': 7.28.5 + '@babel/helper-module-imports': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.28.5 + transitivePeerDependencies: + - supports-color + '@babel/helper-plugin-utils@7.27.1': {} '@babel/helper-string-parser@7.27.1': {} @@ -3755,18 +3778,23 @@ snapshots: '@babel/template': 7.27.2 '@babel/types': 7.28.5 + '@babel/helpers@7.28.4': + dependencies: + '@babel/template': 7.27.2 + '@babel/types': 7.28.5 + '@babel/parser@7.28.5': dependencies: '@babel/types': 7.28.5 - '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.28.3)': + '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.3 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.28.3)': + '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.3 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 '@babel/template@7.27.2': @@ -4046,31 +4074,38 @@ snapshots: '@esbuild/win32-x64@0.27.1': optional: true - '@eslint-community/eslint-utils@4.7.0(eslint@9.34.0(jiti@2.5.1))': + '@eslint-community/eslint-utils@4.7.0(eslint@9.39.2(jiti@2.6.1))': dependencies: - eslint: 9.34.0(jiti@2.5.1) + eslint: 9.39.2(jiti@2.6.1) + eslint-visitor-keys: 3.4.3 + + '@eslint-community/eslint-utils@4.9.0(eslint@9.39.2(jiti@2.6.1))': + dependencies: + eslint: 9.39.2(jiti@2.6.1) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} - '@eslint/config-array@0.21.0': + '@eslint/config-array@0.21.1': dependencies: - '@eslint/object-schema': 2.1.6 - debug: 4.4.1 + '@eslint/object-schema': 2.1.7 + debug: 4.4.3 minimatch: 3.1.2 transitivePeerDependencies: - supports-color - '@eslint/config-helpers@0.3.1': {} + '@eslint/config-helpers@0.4.2': + dependencies: + '@eslint/core': 0.17.0 - '@eslint/core@0.15.2': + '@eslint/core@0.17.0': dependencies: '@types/json-schema': 7.0.15 '@eslint/eslintrc@3.3.1': dependencies: ajv: 6.12.6 - debug: 4.4.1 + debug: 4.4.3 espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 @@ -4081,13 +4116,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.34.0': {} + '@eslint/js@9.39.2': {} - '@eslint/object-schema@2.1.6': {} + '@eslint/object-schema@2.1.7': {} - '@eslint/plugin-kit@0.3.5': + '@eslint/plugin-kit@0.4.1': dependencies: - '@eslint/core': 0.15.2 + '@eslint/core': 0.17.0 levn: 0.4.1 '@humanfs/core@0.19.1': {} @@ -4218,10 +4253,6 @@ snapshots: '@img/sharp-win32-x64@0.34.5': optional: true - '@isaacs/fs-minipass@4.0.1': - dependencies: - minipass: 7.1.2 - '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -4278,30 +4309,30 @@ snapshots: transitivePeerDependencies: - supports-color - '@next/env@16.0.7': {} + '@next/env@16.0.10': {} - '@next/swc-darwin-arm64@16.0.7': + '@next/swc-darwin-arm64@16.0.10': optional: true - '@next/swc-darwin-x64@16.0.7': + '@next/swc-darwin-x64@16.0.10': optional: true - '@next/swc-linux-arm64-gnu@16.0.7': + '@next/swc-linux-arm64-gnu@16.0.10': optional: true - '@next/swc-linux-arm64-musl@16.0.7': + '@next/swc-linux-arm64-musl@16.0.10': optional: true - '@next/swc-linux-x64-gnu@16.0.7': + '@next/swc-linux-x64-gnu@16.0.10': optional: true - '@next/swc-linux-x64-musl@16.0.7': + '@next/swc-linux-x64-musl@16.0.10': optional: true - '@next/swc-win32-arm64-msvc@16.0.7': + '@next/swc-win32-arm64-msvc@16.0.10': optional: true - '@next/swc-win32-x64-msvc@16.0.7': + '@next/swc-win32-x64-msvc@16.0.10': optional: true '@nodelib/fs.scandir@2.1.5': @@ -4316,7 +4347,7 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 - '@rolldown/pluginutils@1.0.0-beta.32': {} + '@rolldown/pluginutils@1.0.0-beta.53': {} '@rollup/rollup-android-arm-eabi@4.41.0': optional: true @@ -4522,9 +4553,9 @@ snapshots: '@types/hast': 3.0.4 hast-util-to-html: 9.0.5 - '@shikijs/core@3.11.0': + '@shikijs/core@3.20.0': dependencies: - '@shikijs/types': 3.11.0 + '@shikijs/types': 3.20.0 '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 hast-util-to-html: 9.0.5 @@ -4541,11 +4572,11 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 oniguruma-to-es: 3.1.1 - '@shikijs/engine-javascript@3.11.0': + '@shikijs/engine-javascript@3.20.0': dependencies: - '@shikijs/types': 3.11.0 + '@shikijs/types': 3.20.0 '@shikijs/vscode-textmate': 10.0.2 - oniguruma-to-es: 4.3.3 + oniguruma-to-es: 4.3.4 '@shikijs/engine-oniguruma@2.1.0': dependencies: @@ -4557,26 +4588,26 @@ snapshots: '@shikijs/types': 2.5.0 '@shikijs/vscode-textmate': 10.0.2 - '@shikijs/engine-oniguruma@3.11.0': + '@shikijs/engine-oniguruma@3.20.0': dependencies: - '@shikijs/types': 3.11.0 + '@shikijs/types': 3.20.0 '@shikijs/vscode-textmate': 10.0.2 '@shikijs/langs@2.5.0': dependencies: '@shikijs/types': 2.5.0 - '@shikijs/langs@3.11.0': + '@shikijs/langs@3.20.0': dependencies: - '@shikijs/types': 3.11.0 + '@shikijs/types': 3.20.0 '@shikijs/themes@2.5.0': dependencies: '@shikijs/types': 2.5.0 - '@shikijs/themes@3.11.0': + '@shikijs/themes@3.20.0': dependencies: - '@shikijs/types': 3.11.0 + '@shikijs/types': 3.20.0 '@shikijs/transformers@2.1.0': dependencies: @@ -4593,7 +4624,7 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 - '@shikijs/types@3.11.0': + '@shikijs/types@3.20.0': dependencies: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 @@ -4604,85 +4635,79 @@ snapshots: dependencies: tslib: 2.8.1 - '@tailwindcss/node@4.1.12': + '@tailwindcss/node@4.1.18': dependencies: '@jridgewell/remapping': 2.3.5 enhanced-resolve: 5.18.3 - jiti: 2.5.1 - lightningcss: 1.30.1 - magic-string: 0.30.17 + jiti: 2.6.1 + lightningcss: 1.30.2 + magic-string: 0.30.21 source-map-js: 1.2.1 - tailwindcss: 4.1.12 + tailwindcss: 4.1.18 - '@tailwindcss/oxide-android-arm64@4.1.12': + '@tailwindcss/oxide-android-arm64@4.1.18': optional: true - '@tailwindcss/oxide-darwin-arm64@4.1.12': + '@tailwindcss/oxide-darwin-arm64@4.1.18': optional: true - '@tailwindcss/oxide-darwin-x64@4.1.12': + '@tailwindcss/oxide-darwin-x64@4.1.18': optional: true - '@tailwindcss/oxide-freebsd-x64@4.1.12': + '@tailwindcss/oxide-freebsd-x64@4.1.18': optional: true - '@tailwindcss/oxide-linux-arm-gnueabihf@4.1.12': + '@tailwindcss/oxide-linux-arm-gnueabihf@4.1.18': optional: true - '@tailwindcss/oxide-linux-arm64-gnu@4.1.12': + '@tailwindcss/oxide-linux-arm64-gnu@4.1.18': optional: true - '@tailwindcss/oxide-linux-arm64-musl@4.1.12': + '@tailwindcss/oxide-linux-arm64-musl@4.1.18': optional: true - '@tailwindcss/oxide-linux-x64-gnu@4.1.12': + '@tailwindcss/oxide-linux-x64-gnu@4.1.18': optional: true - '@tailwindcss/oxide-linux-x64-musl@4.1.12': + '@tailwindcss/oxide-linux-x64-musl@4.1.18': optional: true - '@tailwindcss/oxide-wasm32-wasi@4.1.12': + '@tailwindcss/oxide-wasm32-wasi@4.1.18': optional: true - '@tailwindcss/oxide-win32-arm64-msvc@4.1.12': + '@tailwindcss/oxide-win32-arm64-msvc@4.1.18': optional: true - '@tailwindcss/oxide-win32-x64-msvc@4.1.12': + '@tailwindcss/oxide-win32-x64-msvc@4.1.18': optional: true - '@tailwindcss/oxide@4.1.12': - dependencies: - detect-libc: 2.1.2 - tar: 7.4.3 + '@tailwindcss/oxide@4.1.18': optionalDependencies: - '@tailwindcss/oxide-android-arm64': 4.1.12 - '@tailwindcss/oxide-darwin-arm64': 4.1.12 - '@tailwindcss/oxide-darwin-x64': 4.1.12 - '@tailwindcss/oxide-freebsd-x64': 4.1.12 - '@tailwindcss/oxide-linux-arm-gnueabihf': 4.1.12 - '@tailwindcss/oxide-linux-arm64-gnu': 4.1.12 - '@tailwindcss/oxide-linux-arm64-musl': 4.1.12 - '@tailwindcss/oxide-linux-x64-gnu': 4.1.12 - '@tailwindcss/oxide-linux-x64-musl': 4.1.12 - '@tailwindcss/oxide-wasm32-wasi': 4.1.12 - '@tailwindcss/oxide-win32-arm64-msvc': 4.1.12 - '@tailwindcss/oxide-win32-x64-msvc': 4.1.12 - - '@tailwindcss/postcss@4.1.12': + '@tailwindcss/oxide-android-arm64': 4.1.18 + '@tailwindcss/oxide-darwin-arm64': 4.1.18 + '@tailwindcss/oxide-darwin-x64': 4.1.18 + '@tailwindcss/oxide-freebsd-x64': 4.1.18 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.1.18 + '@tailwindcss/oxide-linux-arm64-gnu': 4.1.18 + '@tailwindcss/oxide-linux-arm64-musl': 4.1.18 + '@tailwindcss/oxide-linux-x64-gnu': 4.1.18 + '@tailwindcss/oxide-linux-x64-musl': 4.1.18 + '@tailwindcss/oxide-wasm32-wasi': 4.1.18 + '@tailwindcss/oxide-win32-arm64-msvc': 4.1.18 + '@tailwindcss/oxide-win32-x64-msvc': 4.1.18 + + '@tailwindcss/postcss@4.1.18': dependencies: '@alloc/quick-lru': 5.2.0 - '@tailwindcss/node': 4.1.12 - '@tailwindcss/oxide': 4.1.12 + '@tailwindcss/node': 4.1.18 + '@tailwindcss/oxide': 4.1.18 postcss: 8.5.6 - tailwindcss: 4.1.12 + tailwindcss: 4.1.18 - '@tailwindcss/typography@0.5.16(tailwindcss@4.1.12)': + '@tailwindcss/typography@0.5.19(tailwindcss@4.1.18)': dependencies: - lodash.castarray: 4.4.0 - lodash.isplainobject: 4.0.6 - lodash.merge: 4.6.2 postcss-selector-parser: 6.0.10 - tailwindcss: 4.1.12 + tailwindcss: 4.1.18 '@types/babel__core@7.20.5': dependencies: @@ -4740,28 +4765,16 @@ snapshots: '@types/ms@2.1.0': {} - '@types/node@24.3.0': - dependencies: - undici-types: 7.10.0 - '@types/node@25.0.2': dependencies: undici-types: 7.16.0 '@types/picomatch@4.0.2': {} - '@types/react-dom@19.1.7(@types/react@19.1.11)': - dependencies: - '@types/react': 19.1.11 - '@types/react-dom@19.2.3(@types/react@19.2.7)': dependencies: '@types/react': 19.2.7 - '@types/react@19.1.11': - dependencies: - csstype: 3.1.3 - '@types/react@19.2.7': dependencies: csstype: 3.2.3 @@ -4776,116 +4789,114 @@ snapshots: '@types/web-bluetooth@0.0.20': {} - '@typescript-eslint/eslint-plugin@8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': + '@typescript-eslint/eslint-plugin@8.49.0(@typescript-eslint/parser@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) - '@typescript-eslint/scope-manager': 8.40.0 - '@typescript-eslint/type-utils': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) - '@typescript-eslint/utils': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) - '@typescript-eslint/visitor-keys': 8.40.0 - eslint: 9.34.0(jiti@2.5.1) - graphemer: 1.4.0 + '@typescript-eslint/parser': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/scope-manager': 8.49.0 + '@typescript-eslint/type-utils': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/utils': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.49.0 + eslint: 9.39.2(jiti@2.6.1) ignore: 7.0.4 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.9.2) - typescript: 5.9.2 + ts-api-utils: 2.1.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': + '@typescript-eslint/parser@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: - '@typescript-eslint/scope-manager': 8.40.0 - '@typescript-eslint/types': 8.40.0 - '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) - '@typescript-eslint/visitor-keys': 8.40.0 + '@typescript-eslint/scope-manager': 8.49.0 + '@typescript-eslint/types': 8.49.0 + '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.49.0 debug: 4.4.3 - eslint: 9.34.0(jiti@2.5.1) - typescript: 5.9.2 + eslint: 9.39.2(jiti@2.6.1) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.40.0(typescript@5.9.2)': + '@typescript-eslint/project-service@8.49.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.9.2) - '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/tsconfig-utils': 8.49.0(typescript@5.9.3) + '@typescript-eslint/types': 8.49.0 debug: 4.4.3 - typescript: 5.9.2 + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.40.0': + '@typescript-eslint/scope-manager@8.49.0': dependencies: - '@typescript-eslint/types': 8.40.0 - '@typescript-eslint/visitor-keys': 8.40.0 + '@typescript-eslint/types': 8.49.0 + '@typescript-eslint/visitor-keys': 8.49.0 - '@typescript-eslint/tsconfig-utils@8.40.0(typescript@5.9.2)': + '@typescript-eslint/tsconfig-utils@8.49.0(typescript@5.9.3)': dependencies: - typescript: 5.9.2 + typescript: 5.9.3 - '@typescript-eslint/type-utils@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': + '@typescript-eslint/type-utils@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: - '@typescript-eslint/types': 8.40.0 - '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) - '@typescript-eslint/utils': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/types': 8.49.0 + '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) debug: 4.4.3 - eslint: 9.34.0(jiti@2.5.1) - ts-api-utils: 2.1.0(typescript@5.9.2) - typescript: 5.9.2 + eslint: 9.39.2(jiti@2.6.1) + ts-api-utils: 2.1.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.40.0': {} + '@typescript-eslint/types@8.49.0': {} - '@typescript-eslint/typescript-estree@8.40.0(typescript@5.9.2)': + '@typescript-eslint/typescript-estree@8.49.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/project-service': 8.40.0(typescript@5.9.2) - '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.9.2) - '@typescript-eslint/types': 8.40.0 - '@typescript-eslint/visitor-keys': 8.40.0 + '@typescript-eslint/project-service': 8.49.0(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.49.0(typescript@5.9.3) + '@typescript-eslint/types': 8.49.0 + '@typescript-eslint/visitor-keys': 8.49.0 debug: 4.4.3 - fast-glob: 3.3.3 - is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.7.3 - ts-api-utils: 2.1.0(typescript@5.9.2) - typescript: 5.9.2 + tinyglobby: 0.2.15 + ts-api-utils: 2.1.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': + '@typescript-eslint/utils@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1)) - '@typescript-eslint/scope-manager': 8.40.0 - '@typescript-eslint/types': 8.40.0 - '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) - eslint: 9.34.0(jiti@2.5.1) - typescript: 5.9.2 + '@eslint-community/eslint-utils': 4.7.0(eslint@9.39.2(jiti@2.6.1)) + '@typescript-eslint/scope-manager': 8.49.0 + '@typescript-eslint/types': 8.49.0 + '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) + eslint: 9.39.2(jiti@2.6.1) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.40.0': + '@typescript-eslint/visitor-keys@8.49.0': dependencies: - '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/types': 8.49.0 eslint-visitor-keys: 4.2.1 '@ungap/structured-clone@1.3.0': {} - '@vitejs/plugin-react@5.0.1(vite@7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': + '@vitejs/plugin-react@5.1.2(vite@7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': dependencies: - '@babel/core': 7.28.3 - '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.3) - '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.3) - '@rolldown/pluginutils': 1.0.0-beta.32 + '@babel/core': 7.28.5 + '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.5) + '@rolldown/pluginutils': 1.0.0-beta.53 '@types/babel__core': 7.20.5 - react-refresh: 0.17.0 - vite: 7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + react-refresh: 0.18.0 + vite: 7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@5.2.1(vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3))': + '@vitejs/plugin-vue@5.2.1(vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3))': dependencies: - vite: 5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1) + vite: 5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1) vue: 3.5.13(typescript@5.9.3) '@vue/compiler-core@3.5.13': @@ -5096,8 +5107,6 @@ snapshots: dependencies: readdirp: 5.0.0 - chownr@3.0.0: {} - cli-cursor@5.0.0: dependencies: restore-cursor: 5.1.0 @@ -5151,10 +5160,6 @@ snapshots: csstype@3.2.3: {} - debug@4.4.1: - dependencies: - ms: 2.1.3 - debug@4.4.3: dependencies: ms: 2.1.3 @@ -5296,13 +5301,20 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-plugin-react-hooks@5.2.0(eslint@9.34.0(jiti@2.5.1)): + eslint-plugin-react-hooks@7.0.1(eslint@9.39.2(jiti@2.6.1)): dependencies: - eslint: 9.34.0(jiti@2.5.1) + '@babel/core': 7.28.3 + '@babel/parser': 7.28.5 + eslint: 9.39.2(jiti@2.6.1) + hermes-parser: 0.25.1 + zod: 4.1.13 + zod-validation-error: 4.0.2(zod@4.1.13) + transitivePeerDependencies: + - supports-color - eslint-plugin-react-refresh@0.4.20(eslint@9.34.0(jiti@2.5.1)): + eslint-plugin-react-refresh@0.4.25(eslint@9.39.2(jiti@2.6.1)): dependencies: - eslint: 9.34.0(jiti@2.5.1) + eslint: 9.39.2(jiti@2.6.1) eslint-scope@8.4.0: dependencies: @@ -5313,25 +5325,24 @@ snapshots: eslint-visitor-keys@4.2.1: {} - eslint@9.34.0(jiti@2.5.1): + eslint@9.39.2(jiti@2.6.1): dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) '@eslint-community/regexpp': 4.12.1 - '@eslint/config-array': 0.21.0 - '@eslint/config-helpers': 0.3.1 - '@eslint/core': 0.15.2 + '@eslint/config-array': 0.21.1 + '@eslint/config-helpers': 0.4.2 + '@eslint/core': 0.17.0 '@eslint/eslintrc': 3.3.1 - '@eslint/js': 9.34.0 - '@eslint/plugin-kit': 0.3.5 + '@eslint/js': 9.39.2 + '@eslint/plugin-kit': 0.4.1 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 - '@types/estree': 1.0.7 - '@types/json-schema': 7.0.15 + '@types/estree': 1.0.8 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.1 + debug: 4.4.3 escape-string-regexp: 4.0.0 eslint-scope: 8.4.0 eslint-visitor-keys: 4.2.1 @@ -5351,7 +5362,7 @@ snapshots: natural-compare: 1.4.0 optionator: 0.9.4 optionalDependencies: - jiti: 2.5.1 + jiti: 2.6.1 transitivePeerDependencies: - supports-color @@ -5487,12 +5498,10 @@ snapshots: globals@14.0.0: {} - globals@16.3.0: {} + globals@16.5.0: {} graceful-fs@4.2.11: {} - graphemer@1.4.0: {} - has-flag@4.0.0: {} hast-util-from-html@2.0.3: @@ -5616,6 +5625,12 @@ snapshots: property-information: 7.1.0 space-separated-tokens: 2.0.2 + hermes-estree@0.25.1: {} + + hermes-parser@0.25.1: + dependencies: + hermes-estree: 0.25.1 + hookable@5.5.3: {} html-void-elements@3.0.0: {} @@ -5662,7 +5677,7 @@ snapshots: isexe@2.0.0: {} - jiti@2.5.1: {} + jiti@2.6.1: {} joycon@3.1.1: {} @@ -5691,50 +5706,54 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - lightningcss-darwin-arm64@1.30.1: + lightningcss-android-arm64@1.30.2: + optional: true + + lightningcss-darwin-arm64@1.30.2: optional: true - lightningcss-darwin-x64@1.30.1: + lightningcss-darwin-x64@1.30.2: optional: true - lightningcss-freebsd-x64@1.30.1: + lightningcss-freebsd-x64@1.30.2: optional: true - lightningcss-linux-arm-gnueabihf@1.30.1: + lightningcss-linux-arm-gnueabihf@1.30.2: optional: true - lightningcss-linux-arm64-gnu@1.30.1: + lightningcss-linux-arm64-gnu@1.30.2: optional: true - lightningcss-linux-arm64-musl@1.30.1: + lightningcss-linux-arm64-musl@1.30.2: optional: true - lightningcss-linux-x64-gnu@1.30.1: + lightningcss-linux-x64-gnu@1.30.2: optional: true - lightningcss-linux-x64-musl@1.30.1: + lightningcss-linux-x64-musl@1.30.2: optional: true - lightningcss-win32-arm64-msvc@1.30.1: + lightningcss-win32-arm64-msvc@1.30.2: optional: true - lightningcss-win32-x64-msvc@1.30.1: + lightningcss-win32-x64-msvc@1.30.2: optional: true - lightningcss@1.30.1: + lightningcss@1.30.2: dependencies: detect-libc: 2.1.2 optionalDependencies: - lightningcss-darwin-arm64: 1.30.1 - lightningcss-darwin-x64: 1.30.1 - lightningcss-freebsd-x64: 1.30.1 - lightningcss-linux-arm-gnueabihf: 1.30.1 - lightningcss-linux-arm64-gnu: 1.30.1 - lightningcss-linux-arm64-musl: 1.30.1 - lightningcss-linux-x64-gnu: 1.30.1 - lightningcss-linux-x64-musl: 1.30.1 - lightningcss-win32-arm64-msvc: 1.30.1 - lightningcss-win32-x64-msvc: 1.30.1 + lightningcss-android-arm64: 1.30.2 + lightningcss-darwin-arm64: 1.30.2 + lightningcss-darwin-x64: 1.30.2 + lightningcss-freebsd-x64: 1.30.2 + lightningcss-linux-arm-gnueabihf: 1.30.2 + lightningcss-linux-arm64-gnu: 1.30.2 + lightningcss-linux-arm64-musl: 1.30.2 + lightningcss-linux-x64-gnu: 1.30.2 + lightningcss-linux-x64-musl: 1.30.2 + lightningcss-win32-arm64-msvc: 1.30.2 + lightningcss-win32-x64-msvc: 1.30.2 lilconfig@3.1.3: {} @@ -5765,10 +5784,6 @@ snapshots: dependencies: p-locate: 5.0.0 - lodash.castarray@4.4.0: {} - - lodash.isplainobject@4.0.6: {} - lodash.merge@4.6.2: {} log-update@6.1.0: @@ -6253,18 +6268,10 @@ snapshots: dependencies: brace-expansion: 2.0.1 - minipass@7.1.2: {} - minisearch@7.1.1: {} - minizlib@3.0.2: - dependencies: - minipass: 7.1.2 - mitt@3.0.1: {} - mkdirp@3.0.1: {} - mlly@1.8.0: dependencies: acorn: 8.15.0 @@ -6286,29 +6293,29 @@ snapshots: natural-compare@1.4.0: {} - next-themes@0.4.6(react-dom@19.2.1(react@19.2.1))(react@19.2.1): + next-themes@0.4.6(react-dom@19.2.3(react@19.2.3))(react@19.2.3): dependencies: - react: 19.2.1 - react-dom: 19.2.1(react@19.2.1) + react: 19.2.3 + react-dom: 19.2.3(react@19.2.3) - next@16.0.7(react-dom@19.2.1(react@19.2.1))(react@19.2.1): + next@16.0.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3): dependencies: - '@next/env': 16.0.7 + '@next/env': 16.0.10 '@swc/helpers': 0.5.15 caniuse-lite: 1.0.30001718 postcss: 8.4.31 - react: 19.2.1 - react-dom: 19.2.1(react@19.2.1) - styled-jsx: 5.1.6(react@19.2.1) + react: 19.2.3 + react-dom: 19.2.3(react@19.2.3) + styled-jsx: 5.1.6(react@19.2.3) optionalDependencies: - '@next/swc-darwin-arm64': 16.0.7 - '@next/swc-darwin-x64': 16.0.7 - '@next/swc-linux-arm64-gnu': 16.0.7 - '@next/swc-linux-arm64-musl': 16.0.7 - '@next/swc-linux-x64-gnu': 16.0.7 - '@next/swc-linux-x64-musl': 16.0.7 - '@next/swc-win32-arm64-msvc': 16.0.7 - '@next/swc-win32-x64-msvc': 16.0.7 + '@next/swc-darwin-arm64': 16.0.10 + '@next/swc-darwin-x64': 16.0.10 + '@next/swc-linux-arm64-gnu': 16.0.10 + '@next/swc-linux-arm64-musl': 16.0.10 + '@next/swc-linux-x64-gnu': 16.0.10 + '@next/swc-linux-x64-musl': 16.0.10 + '@next/swc-win32-arm64-msvc': 16.0.10 + '@next/swc-win32-x64-msvc': 16.0.10 sharp: 0.34.5 transitivePeerDependencies: - '@babel/core' @@ -6336,7 +6343,7 @@ snapshots: regex: 6.0.1 regex-recursion: 6.0.2 - oniguruma-to-es@4.3.3: + oniguruma-to-es@4.3.4: dependencies: oniguruma-parser: 0.12.1 regex: 6.0.1 @@ -6403,11 +6410,11 @@ snapshots: mlly: 1.8.0 pathe: 2.0.3 - postcss-load-config@6.0.1(jiti@2.5.1)(postcss@8.5.6)(tsx@4.21.0)(yaml@2.8.2): + postcss-load-config@6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(yaml@2.8.2): dependencies: lilconfig: 3.1.3 optionalDependencies: - jiti: 2.5.1 + jiti: 2.6.1 postcss: 8.5.6 tsx: 4.21.0 yaml: 2.8.2 @@ -6441,21 +6448,14 @@ snapshots: queue-microtask@1.2.3: {} - react-dom@19.1.1(react@19.1.1): + react-dom@19.2.3(react@19.2.3): dependencies: - react: 19.1.1 - scheduler: 0.26.0 - - react-dom@19.2.1(react@19.2.1): - dependencies: - react: 19.2.1 + react: 19.2.3 scheduler: 0.27.0 - react-refresh@0.17.0: {} + react-refresh@0.18.0: {} - react@19.1.1: {} - - react@19.2.1: {} + react@19.2.3: {} readdirp@4.1.2: {} @@ -6515,13 +6515,13 @@ snapshots: hast-util-from-html: 2.0.3 unified: 11.0.5 - rehype-pretty-code@0.14.1(shiki@3.11.0): + rehype-pretty-code@0.14.1(shiki@3.20.0): dependencies: '@types/hast': 3.0.4 hast-util-to-string: 3.0.1 parse-numeric-range: 1.3.0 rehype-parse: 9.0.1 - shiki: 3.11.0 + shiki: 3.20.0 unified: 11.0.5 unist-util-visit: 5.0.0 @@ -6685,8 +6685,6 @@ snapshots: dependencies: queue-microtask: 1.2.3 - scheduler@0.26.0: {} - scheduler@0.27.0: {} search-insights@2.17.3: {} @@ -6743,14 +6741,14 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 - shiki@3.11.0: + shiki@3.20.0: dependencies: - '@shikijs/core': 3.11.0 - '@shikijs/engine-javascript': 3.11.0 - '@shikijs/engine-oniguruma': 3.11.0 - '@shikijs/langs': 3.11.0 - '@shikijs/themes': 3.11.0 - '@shikijs/types': 3.11.0 + '@shikijs/core': 3.20.0 + '@shikijs/engine-javascript': 3.20.0 + '@shikijs/engine-oniguruma': 3.20.0 + '@shikijs/langs': 3.20.0 + '@shikijs/themes': 3.20.0 + '@shikijs/types': 3.20.0 '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 @@ -6816,10 +6814,10 @@ snapshots: dependencies: inline-style-parser: 0.2.7 - styled-jsx@5.1.6(react@19.2.1): + styled-jsx@5.1.6(react@19.2.3): dependencies: client-only: 0.0.1 - react: 19.2.1 + react: 19.2.3 sucrase@3.35.1: dependencies: @@ -6843,19 +6841,10 @@ snapshots: tabbable@6.2.0: {} - tailwindcss@4.1.12: {} + tailwindcss@4.1.18: {} tapable@2.2.2: {} - tar@7.4.3: - dependencies: - '@isaacs/fs-minipass': 4.0.1 - chownr: 3.0.0 - minipass: 7.1.2 - minizlib: 3.0.2 - mkdirp: 3.0.1 - yallist: 5.0.0 - terser@5.44.1: dependencies: '@jridgewell/source-map': 0.3.11 @@ -6893,15 +6882,15 @@ snapshots: trough@2.2.0: {} - ts-api-utils@2.1.0(typescript@5.9.2): + ts-api-utils@2.1.0(typescript@5.9.3): dependencies: - typescript: 5.9.2 + typescript: 5.9.3 ts-interface-checker@0.1.13: {} tslib@2.8.1: {} - tsup@8.5.1(jiti@2.5.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.2): + tsup@8.5.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.2): dependencies: bundle-require: 5.1.0(esbuild@0.27.1) cac: 6.7.14 @@ -6912,7 +6901,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.5.1)(postcss@8.5.6)(tsx@4.21.0)(yaml@2.8.2) + postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(yaml@2.8.2) resolve-from: 5.0.0 rollup: 4.53.3 source-map: 0.7.6 @@ -6940,25 +6929,21 @@ snapshots: dependencies: prelude-ls: 1.2.1 - typescript-eslint@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2): + typescript-eslint@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) - '@typescript-eslint/parser': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) - '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) - '@typescript-eslint/utils': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) - eslint: 9.34.0(jiti@2.5.1) - typescript: 5.9.2 + '@typescript-eslint/eslint-plugin': 8.49.0(@typescript-eslint/parser@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/parser': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + eslint: 9.39.2(jiti@2.6.1) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - typescript@5.9.2: {} - typescript@5.9.3: {} ufo@1.6.1: {} - undici-types@7.10.0: {} - undici-types@7.16.0: {} unified@11.0.5: @@ -7046,7 +7031,7 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1): + vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1): dependencies: esbuild: 0.21.5 postcss: 8.5.6 @@ -7054,10 +7039,10 @@ snapshots: optionalDependencies: '@types/node': 25.0.2 fsevents: 2.3.3 - lightningcss: 1.30.1 + lightningcss: 1.30.2 terser: 5.44.1 - vite@7.1.3(@types/node@25.0.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): + vite@7.1.3(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): dependencies: esbuild: 0.25.12 fdir: 6.5.0(picomatch@4.0.3) @@ -7068,13 +7053,30 @@ snapshots: optionalDependencies: '@types/node': 25.0.2 fsevents: 2.3.3 - jiti: 2.5.1 - lightningcss: 1.30.1 + jiti: 2.6.1 + lightningcss: 1.30.2 terser: 5.44.1 tsx: 4.21.0 yaml: 2.8.2 - vitepress@1.6.4(@algolia/client-search@5.20.0)(@types/node@25.0.2)(lightningcss@1.30.1)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3): + vite@7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): + dependencies: + esbuild: 0.25.12 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.53.3 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 25.0.2 + fsevents: 2.3.3 + jiti: 2.6.1 + lightningcss: 1.30.2 + terser: 5.44.1 + tsx: 4.21.0 + yaml: 2.8.2 + + vitepress@1.6.4(@algolia/client-search@5.20.0)(@types/node@25.0.2)(lightningcss@1.30.2)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3): dependencies: '@docsearch/css': 3.8.2 '@docsearch/js': 3.8.2(@algolia/client-search@5.20.0)(search-insights@2.17.3) @@ -7083,7 +7085,7 @@ snapshots: '@shikijs/transformers': 2.1.0 '@shikijs/types': 2.5.0 '@types/markdown-it': 14.1.2 - '@vitejs/plugin-vue': 5.2.1(vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3)) + '@vitejs/plugin-vue': 5.2.1(vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3)) '@vue/devtools-api': 7.7.0 '@vue/shared': 3.5.13 '@vueuse/core': 12.5.0(typescript@5.9.3) @@ -7092,7 +7094,7 @@ snapshots: mark.js: 8.11.1 minisearch: 7.1.1 shiki: 2.5.0 - vite: 5.4.14(@types/node@25.0.2)(lightningcss@1.30.1)(terser@5.44.1) + vite: 5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1) vue: 3.5.13(typescript@5.9.3) optionalDependencies: postcss: 8.5.6 @@ -7149,12 +7151,14 @@ snapshots: yallist@3.1.1: {} - yallist@5.0.0: {} - yaml@2.8.2: {} yocto-queue@0.1.0: {} + zod-validation-error@4.0.2(zod@4.1.13): + dependencies: + zod: 4.1.13 + zod@4.1.13: {} zwitch@2.0.4: {} From 677bb4f8711184ca16de8e91737da4aa9bccd329 Mon Sep 17 00:00:00 2001 From: zce Date: Mon, 15 Dec 2025 14:34:16 +0800 Subject: [PATCH 08/48] feat: integrate @velite/plugin-next into Next.js example - Added @velite/plugin-next as a dependency in the example's package.json. - Refactored next.config.ts to utilize withVelite for configuration management. - Updated pnpm-lock.yaml to include workspace references for the new plugin. --- examples/nextjs/next.config.ts | 16 ++--------- examples/nextjs/package.json | 1 + packages/next/index.d.ts | 19 +++++++++++++ packages/next/index.js | 50 ++++++++++++++++++++++++++++++++++ packages/next/package.json | 24 ++++++++++++++++ packages/next/readme.md | 24 ++++++++++++++++ pnpm-lock.yaml | 12 ++++++++ 7 files changed, 132 insertions(+), 14 deletions(-) create mode 100644 packages/next/index.d.ts create mode 100644 packages/next/index.js create mode 100644 packages/next/package.json create mode 100644 packages/next/readme.md diff --git a/examples/nextjs/next.config.ts b/examples/nextjs/next.config.ts index 28b67948..0b9fe042 100644 --- a/examples/nextjs/next.config.ts +++ b/examples/nextjs/next.config.ts @@ -1,18 +1,6 @@ -import type { NextConfig } from 'next' +import { withVelite } from '@velite/plugin-next' -const isDev = process.env.NODE_ENV === 'development' -const isBuild = process.argv.indexOf('build') !== -1 -const isTypegen = process.argv.indexOf('typegen') !== -1 -if (!process.env.VELITE_STARTED && (isDev || isBuild || isTypegen)) { - process.env.VELITE_STARTED = '1' - import('velite').then(m => m.build({ watch: isDev, clean: !isDev })) -} - -const nextConfig: NextConfig = { - /* config options here */ -} - -export default nextConfig +export default withVelite() // legacy next.config.js ↓ (not support turbopack) diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index fb9ef42c..41ef6951 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -15,6 +15,7 @@ "@types/node": "^25.0.2", "@types/react": "19.2.7", "@types/react-dom": "19.2.3", + "@velite/plugin-next": "workspace:*", "next": "16.0.10", "next-themes": "^0.4.6", "postcss": "^8.5.6", diff --git a/packages/next/index.d.ts b/packages/next/index.d.ts new file mode 100644 index 00000000..a40cfc78 --- /dev/null +++ b/packages/next/index.d.ts @@ -0,0 +1,19 @@ +import type { NextConfig } from 'next' +import type { Options as VeliteOptions } from 'velite' + +export type Options = Omit + +type NextConfigFunction = (phase: string, options: { defaultConfig: NextConfig }) => Promise | NextConfig +type NextConfigInput = NextConfig | NextConfigFunction + +/** + * Create a Next.js plugin for integrating Velite + */ +declare const createNextPlugin: (options?: Options) => (nextConfig?: T) => Promise + +/** + * Next.js plugin for integrating Velite + */ +declare const withVelite: ReturnType + +export { createNextPlugin, withVelite, type Options } diff --git a/packages/next/index.js b/packages/next/index.js new file mode 100644 index 00000000..914ca6c2 --- /dev/null +++ b/packages/next/index.js @@ -0,0 +1,50 @@ +/** + * Thanks to `https://github.com/sdorra/content-collections` for Next.js v16+ Velite integration. + */ + +/** + * Create a Next.js plugin for integrating Velite + * @param {Omit} pluginOptions + * @returns {import('next').NextConfig} Next.js plugin + */ +export const createNextPlugin = (pluginOptions = {}) => { + const [command] = process.argv.slice(2).filter(i => !i.startsWith('-')) + + // typegen loads next.config.js + const isTypegen = command === 'typegen' + + // the build step loads next.config.js + const isBuild = command === 'build' + + // starting with v16 next dev doesn't load next.config.js + // next dev - calls next-start in a forked process + // next-start loads next.config.js + // process.argv are not visible by next-start + const isDev = + // to make this compatible with previous versions + // check if command is NOT set (next-start) and we are in development mode + typeof command === 'undefined' && process.env.NODE_ENV === 'development' + + /** + * @param {import('next').NextConfig} nextConfig + * @returns {Promise} + */ + return async (nextConfig = {}) => { + // prevent multiple calls + if (process.env.__VELITE_STARTED) return nextConfig + + // if not dev, build, or typegen, return the next config + if (!isDev && !isBuild && !isTypegen) return nextConfig + + // start velite + process.env.__VELITE_STARTED = '1' + + const { build } = await import('velite') + + await build({ ...pluginOptions, watch: isDev, clean: !isDev }) + + return nextConfig + } +} + +export const withVelite = createNextPlugin() diff --git a/packages/next/package.json b/packages/next/package.json new file mode 100644 index 00000000..c0101e9c --- /dev/null +++ b/packages/next/package.json @@ -0,0 +1,24 @@ +{ + "name": "@velite/plugin-next", + "version": "0.0.1", + "description": "Next.js plugin for integrating Velite", + "type": "module", + "exports": "./index.js", + "types": "./index.d.ts", + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "next-plugin", + "velite", + "content" + ], + "peerDependencies": { + "next": "^16.0.0", + "velite": "workspace:*" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/next/readme.md b/packages/next/readme.md new file mode 100644 index 00000000..0977bfcd --- /dev/null +++ b/packages/next/readme.md @@ -0,0 +1,24 @@ +# @velite/plugin-next + +A Next.js plugin for integrating Velite content processing. + +## Installation + +```bash +npm install -D velite @velite/plugin-next +``` + +## Usage + +```ts +// next.config.ts +import { withVelite } from '@velite/plugin-next' + +export default withVelite({ + // other next config here... +}) +``` + +## License + +[MIT](../../license) © [zce](https://zce.me) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ac83a7d..f3087313 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -141,6 +141,9 @@ importers: '@types/react-dom': specifier: 19.2.3 version: 19.2.3(@types/react@19.2.7) + '@velite/plugin-next': + specifier: workspace:* + version: link:../../packages/next next: specifier: 16.0.10 version: 16.0.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3) @@ -227,6 +230,15 @@ importers: specifier: ^7.2.7 version: 7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + packages/next: + dependencies: + next: + specifier: ^16.0.0 + version: 16.0.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + velite: + specifier: workspace:* + version: link:../.. + packages/vite: dependencies: velite: From 4d75ae022b491c76bd53932b1a03c2c88a6f00c2 Mon Sep 17 00:00:00 2001 From: zce Date: Mon, 15 Dec 2025 14:43:06 +0800 Subject: [PATCH 09/48] feat: refactor file handling and parser integration - Introduced a new parser module to manage file context and configuration. - Updated VeliteFile creation to accept loaders directly. - Adjusted schema imports to utilize the new parser for accessing current file and configuration. - Enabled file nesting in VSCode settings for improved project organization. --- docs/guide/custom-schema.md | 95 ++++++++++++++++++++++++++------ docs/guide/define-collections.md | 36 ++++++++---- docs/guide/last-modified.md | 18 +++--- docs/guide/using-mdx.md | 11 ++-- docs/guide/velite-schemas.md | 2 +- docs/other/snippets.md | 27 +++++---- 6 files changed, 136 insertions(+), 53 deletions(-) diff --git a/docs/guide/custom-schema.md b/docs/guide/custom-schema.md index bcf1a692..3d7412b2 100644 --- a/docs/guide/custom-schema.md +++ b/docs/guide/custom-schema.md @@ -22,13 +22,18 @@ export const title = defineSchema(() => s.string().min(1).max(100)) // for validating email export const email = defineSchema(() => s.string().email({ message: 'Invalid email address' })) -// custom validation logic -export const hello = defineSchema(() => - s.string().refine(value => { - if (value !== 'hello') { - return 'Value must be "hello"' +// custom validation logic using refine +export const hello = defineSchema(() => s.string().refine(value => value === 'hello', 'Value must be "hello"')) + +// custom validation logic using superRefine (for more control) +export const customValidation = defineSchema(() => + s.string().superRefine((value, ctx) => { + if (value.length < 5) { + ctx.addIssue({ code: 'custom', message: 'Value must be at least 5 characters' }) + } + if (!value.includes('@')) { + ctx.addIssue({ code: 'custom', message: 'Value must contain @ symbol' }) } - return true }) ) ``` @@ -40,10 +45,28 @@ Refer to [Zod documentation](https://zod.dev) for more information about Zod. ```ts import { defineSchema, s } from 'velite' -// for transforming title +// for transforming title (simple transform) export const title = defineSchema(() => s.string().transform(value => value.toUpperCase())) -// ... +// for transforming with error handling (using ctx.addIssue) +export const safeTransform = defineSchema(() => + s.string().transform((value, ctx) => { + try { + return value.toUpperCase() + } catch (err) { + ctx.addIssue({ fatal: true, code: 'custom', message: 'Transform failed' }) + return value + } + }) +) + +// async transform (zod 4 supports async transforms) +export const asyncTransform = defineSchema(() => + s.string().transform(async (value, ctx) => { + // async operations... + return processedValue + }) +) ``` ### Example @@ -59,7 +82,7 @@ import type { Image } from 'velite' * Remote Image with metadata schema */ export const remoteImage = () => - s.string().transform(async (value, { addIssue }) => { + s.string().transform(async (value, ctx) => { try { const response = await fetch(value) const blob = await response.blob() @@ -69,7 +92,7 @@ export const remoteImage = () => return { src: value, ...metadata } } catch (err) { const message = err instanceof Error ? err.message : String(err) - addIssue({ fatal: true, code: 'custom', message }) + ctx.addIssue({ fatal: true, code: 'custom', message }) return null as never } }) @@ -78,22 +101,62 @@ export const remoteImage = () => ## Schema Context > [!TIP] -> Considering that Velite's scenario often needs to obtain metadata information about the current file in the schema, Velite does not use the original Zod package. Instead, it uses a custom Zod package that provides a `meta` member in the schema context. +> In Zod 4, the context object (`ctx`) in `refine`, `superRefine`, and `transform` provides an `addIssue()` method for adding validation errors. Velite extends this context to provide access to file metadata through `context()` function. + +### Using Context API ```ts -import { defineSchema, s } from 'velite' +import { context, defineSchema, s } from 'velite' -// convert a nonexistent field +// Access file context in transform export const path = defineSchema(() => s.custom().transform((value, ctx) => { - if (ctx.meta.path) { - return ctx.meta.path + // Use context() to access current file information + const { file, config } = context() + + if (value == null) { + // Use ctx.addIssue() to add validation errors (Zod 4 API) + ctx.addIssue({ fatal: false, code: 'custom', message: 'Using file path as fallback' }) + return file.path } return value }) ) ``` +### Context API Reference + +The `context()` function returns an object with: + +- `config`: The resolved Velite configuration +- `file`: The current [`VeliteFile`](../reference/types.md#velitefile) being processed + +### Error Handling in Transforms + +```ts +import { defineSchema, s } from 'velite' + +export const safeTransform = defineSchema(() => + s.string().transform(async (value, ctx) => { + try { + // async operation + const result = await processValue(value) + return result + } catch (err) { + // Add error issue using Zod 4 API + ctx.addIssue({ + fatal: true, // Set to true to stop processing + code: 'custom', // Error code + message: err.message // Error message + }) + return null as never // Type assertion for TypeScript + } + }) +) +``` + ### Reference -the type of `meta` is `ZodMeta`, which extends [`VeliteFile`](../reference/types.md#velitefile). +- `context()` returns `{ config: Config, file: VeliteFile }` +- `ctx.addIssue()` accepts `{ fatal?: boolean, code: string, message: string }` +- See [`VeliteFile`](../reference/types.md#velitefile) for file metadata structure diff --git a/docs/guide/define-collections.md b/docs/guide/define-collections.md index b924f73c..9b4750bf 100644 --- a/docs/guide/define-collections.md +++ b/docs/guide/define-collections.md @@ -156,35 +156,49 @@ const posts = defineCollection({ ### Transform Context Metadata -The `transform()` function can receive a second argument, which is the context object. This is useful for adding computed fields to the content items in a collection. +The `transform()` function can receive a second argument, which is the context object (in Zod 4). To access file metadata, use the `context()` function from Velite. ```js +import { context, s } from 'velite' + const posts = defineCollection({ schema: s .object({ // fields }) - .transform((data, { meta }) => ({ - ...data, - // computed fields - path: meta.path // or parse to filename based slug - })) + .transform(data => { + const { file } = context() + return { + ...data, + // computed fields + path: file.path, // or parse to filename based slug + basename: file.basename + } + }) }) ``` -the type of `meta` is `ZodMeta`, which extends [`VeliteFile`](../reference/types.md#velitefile). for more information, see [Custom Schema](custom-schema.md). +For more information about accessing file context, see [Custom Schema](custom-schema.md). ## Content Body -Velite's built-in loader keeps content's raw body in `meta.content`, and the plain text body in `meta.plain`. +Velite's built-in loader keeps content's raw body in `file.content`, and the plain text body in `file.plain`. -To add them as a field, you can use a custom schema. +To add them as a field, you can use a custom schema with the `context()` function. ```js +import { context, s } from 'velite' + const posts = defineCollection({ schema: s.object({ - content: s.custom().transform((data, { meta }) => meta.content), - plain: s.custom().transform((data, { meta }) => meta.plain) + content: s.custom().transform(() => { + const { file } = context() + return file.content + }), + plain: s.custom().transform(() => { + const { file } = context() + return file.plain + }) }) }) ``` diff --git a/docs/guide/last-modified.md b/docs/guide/last-modified.md index ee3eeb0c..6ec31e9e 100644 --- a/docs/guide/last-modified.md +++ b/docs/guide/last-modified.md @@ -12,17 +12,18 @@ Create a timestamp schema based on file stat. ```ts import { stat } from 'fs/promises' -import { defineSchema } from 'velite' +import { context, defineSchema } from 'velite' const timestamp = defineSchema(() => s .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { meta, addIssue }) => { + .transform(async (value, ctx) => { if (value != null) { - addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the file modified timestamp' }) + ctx.addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the file modified timestamp' }) } - const stats = await stat(meta.path) + const { file } = context() + const stats = await stat(file.path) return stats.mtime.toISOString() }) ) @@ -45,18 +46,19 @@ const posts = defineCollection({ ```ts import { exec } from 'child_process' import { promisify } from 'util' -import { defineSchema } from 'velite' +import { context, defineSchema } from 'velite' const execAsync = promisify(exec) const timestamp = defineSchema(() => s .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { meta, addIssue }) => { + .transform(async (value, ctx) => { if (value != null) { - addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) + ctx.addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) } - const { stdout } = await execAsync(`git log -1 --format=%cd ${meta.path}`) + const { file } = context() + const { stdout } = await execAsync(`git log -1 --format=%cd ${file.path}`) return new Date(stdout || Date.now()).toISOString() }) ) diff --git a/docs/guide/using-mdx.md b/docs/guide/using-mdx.md index 5a52ab6b..6d9e495a 100644 --- a/docs/guide/using-mdx.md +++ b/docs/guide/using-mdx.md @@ -312,10 +312,11 @@ const compileMdx = async (source: string, path: string, options: CompileOptions) } export const mdxBundle = (options: MdxOptions = {}) => - custom().transform(async (value, { meta: { path, content, config }, addIssue }) => { - value = value ?? content + custom().transform(async (value, ctx) => { + const { file, config } = context() + value = value ?? file.content if (value == null) { - addIssue({ fatal: true, code: 'custom', message: 'The content is empty' }) + ctx.addIssue({ fatal: true, code: 'custom', message: 'The content is empty' }) return null as never } @@ -339,9 +340,9 @@ export const mdxBundle = (options: MdxOptions = {}) => const compilerOptions = { ...config.mdx, ...options, outputFormat, remarkPlugins, rehypePlugins } try { - return await compileMdx(value, path, compilerOptions) + return await compileMdx(value, file.path, compilerOptions) } catch (err: any) { - addIssue({ fatal: true, code: 'custom', message: err.message }) + ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) return null as never } }) diff --git a/docs/guide/velite-schemas.md b/docs/guide/velite-schemas.md index a326a051..8cec9cd0 100644 --- a/docs/guide/velite-schemas.md +++ b/docs/guide/velite-schemas.md @@ -49,7 +49,7 @@ name: s.unique('taxonomies') // 'foo' => 'foo' // case 2. non-unique value (in all unique by 'taxonomies') -// 'foo' => issue 'Already exists' +// 'foo' => issue 'Duplicate 'foo' with '/path/to/existing/file.yml'' ``` ### Parameters diff --git a/docs/other/snippets.md b/docs/other/snippets.md index f9f1902a..3c8eb14d 100644 --- a/docs/other/snippets.md +++ b/docs/other/snippets.md @@ -11,12 +11,13 @@ import { defineSchema } from 'velite' const timestamp = defineSchema(() => s .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { meta, addIssue }) => { + .transform(async (value, ctx) => { if (value != null) { - addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the file modified timestamp' }) + ctx.addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the file modified timestamp' }) } - const stats = await stat(meta.path) + const { file } = context() + const stats = await stat(file.path) return stats.mtime.toISOString() }) ) @@ -43,11 +44,12 @@ const execAsync = promisify(exec) const timestamp = defineSchema(() => s .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { meta, addIssue }) => { + .transform(async (value, ctx) => { if (value != null) { - addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) + ctx.addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) } - const { stdout } = await execAsync(`git log -1 --format=%cd ${meta.path}`) + const { file } = context() + const { stdout } = await execAsync(`git log -1 --format=%cd ${file.path}`) return new Date(stdout || Date.now()).toISOString() }) ) @@ -73,7 +75,7 @@ import type { Image } from 'velite' * Remote Image with metadata schema */ export const remoteImage = () => - s.string().transform(async (value, { addIssue }) => { + s.string().transform(async (value, ctx) => { try { const response = await fetch(value) const blob = await response.blob() @@ -83,7 +85,7 @@ export const remoteImage = () => return { src: value, ...metadata } } catch (err) { const message = err instanceof Error ? err.message : String(err) - addIssue({ fatal: true, code: 'custom', message }) + ctx.addIssue({ fatal: true, code: 'custom', message }) return null as never } }) @@ -273,16 +275,17 @@ export interface ExcerptOptions { } export const excerpt = ({ separator = 'more', length = 300 }: ExcerptOptions = {}) => - custom().transform(async (value, { meta: { path, content, config } }) => { - if (value == null && content != null) { - value = content + custom().transform(async (value, ctx) => { + const { file, config } = context() + if (value == null && file.content != null) { + value = file.content } try { const mdast = fromMarkdown(value) const hast = raw(toHast(mdast, { allowDangerousHtml: true })) const exHast = hastExcerpt(hast, { comment: separator, maxSearchSize: 1024 }) const output = exHast ?? truncate(hast, { size: length, ellipsis: '…' }) - await rehypeCopyLinkedFiles(config.output)(output, { path }) + await rehypeCopyLinkedFiles(config.output)(output, { path: file.path }) return toHtml(output) } catch (err: any) { ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) From aa7c8dd2a56998858977bd62ca098455b9e8a080 Mon Sep 17 00:00:00 2001 From: zce Date: Mon, 15 Dec 2025 14:46:14 +0800 Subject: [PATCH 10/48] feat: refactor file handling and parser integration - Introduced a new parser module to manage file context and configuration. - Updated VeliteFile creation to accept loaders directly. - Adjusted schema imports to utilize the new parser for accessing current file and configuration. - Enabled file nesting in VSCode settings for improved project organization. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a0a576e5..bd501ebf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "velite", - "version": "0.3.0", + "version": "1.0.0-alpha.1", "description": "Turns Markdown / MDX, YAML, JSON, or other files into app's data layer with type-safe schema.", "keywords": [ "contentlayer", From 0bf4f75e7b0203ce95c8bbe28f1748e7b2eb7b88 Mon Sep 17 00:00:00 2001 From: zce Date: Mon, 15 Dec 2025 14:51:31 +0800 Subject: [PATCH 11/48] feat: refactor file handling and parser integration - Introduced a new parser module to manage file context and configuration. - Updated VeliteFile creation to accept loaders directly. - Adjusted schema imports to utilize the new parser for accessing current file and configuration. - Enabled file nesting in VSCode settings for improved project organization. --- packages/vite/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/package.json b/packages/vite/package.json index cedd0872..bc0da599 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -1,6 +1,6 @@ { "name": "@velite/plugin-vite", - "version": "0.0.1", + "version": "0.0.2", "description": "Vite plugin for integrating Velite", "type": "module", "exports": "./index.js", From d405ef2c996b73318242621b580da2dd1e08dc38 Mon Sep 17 00:00:00 2001 From: zce Date: Sat, 16 May 2026 17:31:28 +0800 Subject: [PATCH 12/48] fix: align zod 4 schema parsing --- docs/guide/custom-schema.md | 4 +- docs/guide/last-modified.md | 17 +- docs/guide/using-mdx.md | 3 +- docs/other/snippets.md | 27 +- docs/reference/config.md | 4 +- docs/reference/types.md | 9 +- examples/basic/velite.config.js | 10 +- examples/nextjs/package.json | 22 +- examples/nextjs/velite.config.ts | 8 +- examples/vite/package.json | 28 +- examples/vite/tsconfig.app.json | 1 - examples/vite/velite.config.ts | 8 +- package.json | 22 +- packages/vite/package.json | 2 +- pnpm-lock.yaml | 2517 +++++++++++++++--------------- pnpm-workspace.yaml | 8 +- src/schemas/excerpt.ts | 18 +- src/schemas/index.ts | 6 +- src/schemas/markdown.ts | 74 +- src/schemas/mdx.ts | 84 +- src/schemas/metadata.ts | 52 +- src/schemas/path.ts | 20 +- src/schemas/raw.ts | 8 +- src/schemas/toc.ts | 8 +- test/schema.ts | 39 + tsconfig.json | 1 + 26 files changed, 1493 insertions(+), 1507 deletions(-) create mode 100644 test/schema.ts diff --git a/docs/guide/custom-schema.md b/docs/guide/custom-schema.md index 3d7412b2..48545a86 100644 --- a/docs/guide/custom-schema.md +++ b/docs/guide/custom-schema.md @@ -110,13 +110,11 @@ import { context, defineSchema, s } from 'velite' // Access file context in transform export const path = defineSchema(() => - s.custom().transform((value, ctx) => { + s.custom().transform(value => { // Use context() to access current file information const { file, config } = context() if (value == null) { - // Use ctx.addIssue() to add validation errors (Zod 4 API) - ctx.addIssue({ fatal: false, code: 'custom', message: 'Using file path as fallback' }) return file.path } return value diff --git a/docs/guide/last-modified.md b/docs/guide/last-modified.md index 6ec31e9e..e74c8f42 100644 --- a/docs/guide/last-modified.md +++ b/docs/guide/last-modified.md @@ -16,12 +16,9 @@ import { context, defineSchema } from 'velite' const timestamp = defineSchema(() => s - .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, ctx) => { - if (value != null) { - ctx.addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the file modified timestamp' }) - } - + .custom(i => typeof i === 'string') + .optional() + .transform(async () => { const { file } = context() const stats = await stat(file.path) return stats.mtime.toISOString() @@ -52,11 +49,9 @@ const execAsync = promisify(exec) const timestamp = defineSchema(() => s - .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, ctx) => { - if (value != null) { - ctx.addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) - } + .custom(i => typeof i === 'string') + .optional() + .transform(async () => { const { file } = context() const { stdout } = await execAsync(`git log -1 --format=%cd ${file.path}`) return new Date(stdout || Date.now()).toISOString() diff --git a/docs/guide/using-mdx.md b/docs/guide/using-mdx.md index 6d9e495a..2001e7f1 100644 --- a/docs/guide/using-mdx.md +++ b/docs/guide/using-mdx.md @@ -260,6 +260,7 @@ import { dirname, join } from 'node:path' import { globalExternals } from '@fal-works/esbuild-plugin-global-externals' import mdxPlugin from '@mdx-js/esbuild' import { build } from 'esbuild' +import { context, s } from 'velite' import type { Plugin } from 'esbuild' @@ -312,7 +313,7 @@ const compileMdx = async (source: string, path: string, options: CompileOptions) } export const mdxBundle = (options: MdxOptions = {}) => - custom().transform(async (value, ctx) => { + s.custom().transform(async (value, ctx) => { const { file, config } = context() value = value ?? file.content if (value == null) { diff --git a/docs/other/snippets.md b/docs/other/snippets.md index 3c8eb14d..b4d61212 100644 --- a/docs/other/snippets.md +++ b/docs/other/snippets.md @@ -6,16 +6,13 @@ ```ts import { stat } from 'fs/promises' -import { defineSchema } from 'velite' +import { context, defineSchema } from 'velite' const timestamp = defineSchema(() => s - .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, ctx) => { - if (value != null) { - ctx.addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the file modified timestamp' }) - } - + .custom(i => typeof i === 'string') + .optional() + .transform(async () => { const { file } = context() const stats = await stat(file.path) return stats.mtime.toISOString() @@ -37,17 +34,15 @@ const posts = defineCollection({ ```ts import { exec } from 'child_process' import { promisify } from 'util' -import { defineSchema } from 'velite' +import { context, defineSchema } from 'velite' const execAsync = promisify(exec) const timestamp = defineSchema(() => s - .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, ctx) => { - if (value != null) { - ctx.addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) - } + .custom(i => typeof i === 'string') + .optional() + .transform(async () => { const { file } = context() const { stdout } = await execAsync(`git log -1 --format=%cd ${file.path}`) return new Date(stdout || Date.now()).toISOString() @@ -255,9 +250,7 @@ import { toHtml } from 'hast-util-to-html' import { truncate } from 'hast-util-truncate' import { fromMarkdown } from 'mdast-util-from-markdown' import { toHast } from 'mdast-util-to-hast' - -import { extractHastLinkedFiles } from '../assets' -import { custom } from './zod' +import { context, s } from 'velite' export interface ExcerptOptions { /** @@ -275,7 +268,7 @@ export interface ExcerptOptions { } export const excerpt = ({ separator = 'more', length = 300 }: ExcerptOptions = {}) => - custom().transform(async (value, ctx) => { + s.custom().transform(async (value, ctx) => { const { file, config } = context() if (value == null && file.content != null) { value = file.content diff --git a/docs/reference/config.md b/docs/reference/config.md index 5753e9d9..3c6dd5e5 100644 --- a/docs/reference/config.md +++ b/docs/reference/config.md @@ -276,7 +276,7 @@ More options, see [MDX Compile Options](https://mdxjs.com/packages/mdx/#compileo ## `prepare` -- Type: `(data: Result, context: Context) => Promisable` +- Type: `(data: Result, context: HookContext) => Promisable` Data prepare hook, executed before write to file. You can apply additional processing to the output data, such as modify them, add missing data, handle relationships, or write them to files. return false to prevent the default output to a file if you wanted. @@ -299,6 +299,6 @@ export default defineConfig({ ## `complete` -- Type: `(data: Result, context: Context) => Promisable` +- Type: `(data: Result, context: HookContext) => Promisable` Build success hook, executed after the build is complete. You can do anything after the build is complete, such as print some tips or deploy the output files. diff --git a/docs/reference/types.md b/docs/reference/types.md index e7072494..f5800d2d 100644 --- a/docs/reference/types.md +++ b/docs/reference/types.md @@ -66,8 +66,6 @@ interface Loader { ## VeliteFile ```ts -interface ZodMeta extends VeliteFile {} - class VeliteFile extends VFile { /** * Get parsed records from file @@ -102,11 +100,12 @@ class VeliteFile extends VFile { static get(path: string): VeliteFile | undefined /** - * Create meta object from file path - * @param options meta options + * Create file object from file path + * @param path file path + * @param loaders file loaders * @returns resolved meta object */ - static async create({ path, config }: { path: string; config: Config }): Promise + static async create(path: string, loaders: Loader[]): Promise } ``` diff --git a/examples/basic/velite.config.js b/examples/basic/velite.config.js index cc873b7c..2a5ea79c 100644 --- a/examples/basic/velite.config.js +++ b/examples/basic/velite.config.js @@ -4,7 +4,7 @@ import { exec } from 'node:child_process' import { promisify } from 'node:util' import { context, defineConfig, s } from 'velite' -const slugify = input => +const slugify = (/** @type {string} */ input) => input .toLowerCase() .replace(/\s+/g, '-') @@ -24,11 +24,9 @@ const meta = s const execAsync = promisify(exec) const timestamp = () => s - .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { addIssue }) => { - if (value != null) { - addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) - } + .custom(i => typeof i === 'string') + .optional() + .transform(async () => { const { stdout } = await execAsync(`git log -1 --format=%cd ${context().file.path}`) return new Date(stdout || Date.now()).toISOString() }) diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index 41ef6951..54f3e8f1 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -10,21 +10,21 @@ "content": "velite --clean" }, "dependencies": { - "@tailwindcss/postcss": "^4.1.18", + "@tailwindcss/postcss": "^4.3.0", "@tailwindcss/typography": "^0.5.19", - "@types/node": "^25.0.2", - "@types/react": "19.2.7", + "@types/node": "^25.8.0", + "@types/react": "19.2.14", "@types/react-dom": "19.2.3", "@velite/plugin-next": "workspace:*", - "next": "16.0.10", + "next": "16.2.6", "next-themes": "^0.4.6", - "postcss": "^8.5.6", - "react": "19.2.3", - "react-dom": "19.2.3", - "rehype-pretty-code": "^0.14.1", - "shiki": "^3.20.0", - "tailwindcss": "^4.1.18", - "typescript": "^5.9.3", + "postcss": "^8.5.14", + "react": "19.2.6", + "react-dom": "19.2.6", + "rehype-pretty-code": "^0.14.3", + "shiki": "^4.0.2", + "tailwindcss": "^4.3.0", + "typescript": "^6.0.3", "velite": "workspace:*" } } diff --git a/examples/nextjs/velite.config.ts b/examples/nextjs/velite.config.ts index e6a0dca6..d7123505 100644 --- a/examples/nextjs/velite.config.ts +++ b/examples/nextjs/velite.config.ts @@ -25,11 +25,9 @@ const execAsync = promisify(exec) // refer to https://velite.js.org/guide/last-modified#based-on-git-timestamp for more details const timestamp = () => s - .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { addIssue }) => { - if (value != null) { - addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) - } + .custom(i => typeof i === 'string') + .optional() + .transform(async () => { const { stdout } = await execAsync(`git log -1 --format=%cd ${context().file.path}`) return new Date(stdout || Date.now()).toISOString() }) diff --git a/examples/vite/package.json b/examples/vite/package.json index 8dcfaa30..636d52dd 100644 --- a/examples/vite/package.json +++ b/examples/vite/package.json @@ -10,24 +10,24 @@ "preview": "vite preview" }, "dependencies": { - "react": "^19.2.3", - "react-dom": "^19.2.3" + "react": "^19.2.6", + "react-dom": "^19.2.6" }, "devDependencies": { - "@eslint/js": "^9.39.2", - "@types/react": "^19.2.7", + "@eslint/js": "^10.0.1", + "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@velite/plugin-vite": "workspace:*", - "@vitejs/plugin-react": "^5.1.2", - "eslint": "^9.39.2", - "eslint-plugin-react-hooks": "^7.0.1", - "eslint-plugin-react-refresh": "^0.4.25", - "globals": "^16.5.0", - "rehype-pretty-code": "^0.14.1", - "shiki": "^3.20.0", - "typescript": "^5.9.3", - "typescript-eslint": "^8.49.0", + "@vitejs/plugin-react": "^6.0.2", + "eslint": "^10.4.0", + "eslint-plugin-react-hooks": "^7.1.1", + "eslint-plugin-react-refresh": "^0.5.2", + "globals": "^17.6.0", + "rehype-pretty-code": "^0.14.3", + "shiki": "^4.0.2", + "typescript": "^6.0.3", + "typescript-eslint": "^8.59.3", "velite": "workspace:*", - "vite": "^7.2.7" + "vite": "^8.0.13" } } diff --git a/examples/vite/tsconfig.app.json b/examples/vite/tsconfig.app.json index 7e50d0b3..3ad10469 100644 --- a/examples/vite/tsconfig.app.json +++ b/examples/vite/tsconfig.app.json @@ -21,7 +21,6 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true, - "baseUrl": ".", "paths": { "@/*": ["./*"], "#velite": ["./.velite"] diff --git a/examples/vite/velite.config.ts b/examples/vite/velite.config.ts index e6a0dca6..d7123505 100644 --- a/examples/vite/velite.config.ts +++ b/examples/vite/velite.config.ts @@ -25,11 +25,9 @@ const execAsync = promisify(exec) // refer to https://velite.js.org/guide/last-modified#based-on-git-timestamp for more details const timestamp = () => s - .custom(i => i === undefined || typeof i === 'string') - .transform(async (value, { addIssue }) => { - if (value != null) { - addIssue({ fatal: false, code: 'custom', message: '`s.timestamp()` schema will resolve the value from `git log -1 --format=%cd`' }) - } + .custom(i => typeof i === 'string') + .optional() + .transform(async () => { const { stdout } = await execAsync(`git log -1 --format=%cd ${context().file.path}`) return new Date(stdout || Date.now()).toISOString() }) diff --git a/package.json b/package.json index bd501ebf..a6ec6090 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ ], "format": "esm", "platform": "node", - "target": "node18", + "target": "node20", "banner": { "js": "import {createRequire as __createRequire} from 'module';const require=__createRequire(import.meta.url);" }, @@ -58,16 +58,16 @@ }, "dependencies": { "@mdx-js/mdx": "^3.1.1", - "esbuild": "^0.27.1", + "esbuild": "^0.28.0", "sharp": "^0.34.5", "terser": "^5.44.1", - "zod": "^4.1.13" + "zod": "^4.4.3" }, "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@types/hast": "^3.0.4", "@types/mdast": "^4.0.4", - "@types/node": "^25.0.2", + "@types/node": "^25.8.0", "@types/picomatch": "^4.0.2", "chokidar": "^5.0.0", "fast-glob": "^3.3.3", @@ -77,8 +77,8 @@ "mdast-util-from-markdown": "^2.0.2", "mdast-util-to-hast": "^13.2.1", "mdast-util-toc": "^7.1.0", - "picomatch": "^4.0.3", - "prettier": "^3.7.4", + "picomatch": "^4.0.4", + "prettier": "^3.8.3", "rehype-raw": "^7.0.0", "rehype-stringify": "^10.0.1", "remark-gfm": "^4.0.1", @@ -86,16 +86,16 @@ "remark-rehype": "^11.1.2", "simple-git-hooks": "^2.13.1", "tsup": "^8.5.1", - "tsx": "^4.21.0", - "typescript": "^5.9.3", + "tsx": "^4.22.0", + "typescript": "^6.0.3", "unified": "^11.0.5", "unist-util-visit": "^5.0.0", "vfile": "^6.0.3", "vfile-reporter": "^8.1.1", - "yaml": "^2.8.2" + "yaml": "^2.9.0" }, - "packageManager": "pnpm@10.15.0", + "packageManager": "pnpm@11.1.2", "engines": { - "node": "^18.20.0 || >=20.3.0" + "node": ">=20.19.0" } } diff --git a/packages/vite/package.json b/packages/vite/package.json index bc0da599..e77ecee2 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -15,7 +15,7 @@ "content" ], "peerDependencies": { - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", "velite": "workspace:*" }, "publishConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3087313..176bb8c1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^3.1.1 version: 3.1.1 esbuild: - specifier: ^0.27.1 - version: 0.27.1 + specifier: ^0.28.0 + version: 0.28.0 sharp: specifier: ^0.34.5 version: 0.34.5 @@ -21,12 +21,12 @@ importers: specifier: ^5.44.1 version: 5.44.1 zod: - specifier: ^4.1.13 - version: 4.1.13 + specifier: ^4.4.3 + version: 4.4.3 devDependencies: '@ianvs/prettier-plugin-sort-imports': specifier: ^4.7.0 - version: 4.7.0(@vue/compiler-sfc@3.5.13)(prettier@3.7.4) + version: 4.7.0(@vue/compiler-sfc@3.5.13)(prettier@3.8.3) '@types/hast': specifier: ^3.0.4 version: 3.0.4 @@ -34,8 +34,8 @@ importers: specifier: ^4.0.4 version: 4.0.4 '@types/node': - specifier: ^25.0.2 - version: 25.0.2 + specifier: ^25.8.0 + version: 25.8.0 '@types/picomatch': specifier: ^4.0.2 version: 4.0.2 @@ -64,11 +64,11 @@ importers: specifier: ^7.1.0 version: 7.1.0 picomatch: - specifier: ^4.0.3 - version: 4.0.3 + specifier: ^4.0.4 + version: 4.0.4 prettier: - specifier: ^3.7.4 - version: 3.7.4 + specifier: ^3.8.3 + version: 3.8.3 rehype-raw: specifier: ^7.0.0 version: 7.0.0 @@ -89,13 +89,13 @@ importers: version: 2.13.1 tsup: specifier: ^8.5.1 - version: 8.5.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.2) + version: 8.5.1(jiti@2.6.1)(postcss@8.5.14)(tsx@4.22.0)(typescript@6.0.3)(yaml@2.9.0) tsx: - specifier: ^4.21.0 - version: 4.21.0 + specifier: ^4.22.0 + version: 4.22.0 typescript: - specifier: ^5.9.3 - version: 5.9.3 + specifier: ^6.0.3 + version: 6.0.3 unified: specifier: ^11.0.5 version: 11.0.5 @@ -109,14 +109,14 @@ importers: specifier: ^8.1.1 version: 8.1.1 yaml: - specifier: ^2.8.2 - version: 2.8.2 + specifier: ^2.9.0 + version: 2.9.0 docs: devDependencies: vitepress: specifier: latest - version: 1.6.4(@algolia/client-search@5.20.0)(@types/node@25.0.2)(lightningcss@1.30.2)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3) + version: 1.6.4(@algolia/client-search@5.20.0)(@types/node@25.8.0)(lightningcss@1.32.0)(postcss@8.5.14)(search-insights@2.17.3)(terser@5.44.1)(typescript@6.0.3) examples/basic: devDependencies: @@ -127,50 +127,50 @@ importers: examples/nextjs: dependencies: '@tailwindcss/postcss': - specifier: ^4.1.18 - version: 4.1.18 + specifier: ^4.3.0 + version: 4.3.0 '@tailwindcss/typography': specifier: ^0.5.19 - version: 0.5.19(tailwindcss@4.1.18) + version: 0.5.19(tailwindcss@4.3.0) '@types/node': - specifier: ^25.0.2 - version: 25.0.2 + specifier: ^25.8.0 + version: 25.8.0 '@types/react': - specifier: 19.2.7 - version: 19.2.7 + specifier: 19.2.14 + version: 19.2.14 '@types/react-dom': specifier: 19.2.3 - version: 19.2.3(@types/react@19.2.7) + version: 19.2.3(@types/react@19.2.14) '@velite/plugin-next': specifier: workspace:* version: link:../../packages/next next: - specifier: 16.0.10 - version: 16.0.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 16.2.6 + version: 16.2.6(react-dom@19.2.6(react@19.2.6))(react@19.2.6) next-themes: specifier: ^0.4.6 - version: 0.4.6(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 0.4.6(react-dom@19.2.6(react@19.2.6))(react@19.2.6) postcss: - specifier: ^8.5.6 - version: 8.5.6 + specifier: ^8.5.14 + version: 8.5.14 react: - specifier: 19.2.3 - version: 19.2.3 + specifier: 19.2.6 + version: 19.2.6 react-dom: - specifier: 19.2.3 - version: 19.2.3(react@19.2.3) + specifier: 19.2.6 + version: 19.2.6(react@19.2.6) rehype-pretty-code: - specifier: ^0.14.1 - version: 0.14.1(shiki@3.20.0) + specifier: ^0.14.3 + version: 0.14.3(shiki@4.0.2) shiki: - specifier: ^3.20.0 - version: 3.20.0 + specifier: ^4.0.2 + version: 4.0.2 tailwindcss: - specifier: ^4.1.18 - version: 4.1.18 + specifier: ^4.3.0 + version: 4.3.0 typescript: - specifier: ^5.9.3 - version: 5.9.3 + specifier: ^6.0.3 + version: 6.0.3 velite: specifier: workspace:* version: link:../.. @@ -178,63 +178,63 @@ importers: examples/vite: dependencies: react: - specifier: ^19.2.3 - version: 19.2.3 + specifier: ^19.2.6 + version: 19.2.6 react-dom: - specifier: ^19.2.3 - version: 19.2.3(react@19.2.3) + specifier: ^19.2.6 + version: 19.2.6(react@19.2.6) devDependencies: '@eslint/js': - specifier: ^9.39.2 - version: 9.39.2 + specifier: ^10.0.1 + version: 10.0.1(eslint@10.4.0(jiti@2.6.1)) '@types/react': - specifier: ^19.2.7 - version: 19.2.7 + specifier: ^19.2.14 + version: 19.2.14 '@types/react-dom': specifier: ^19.2.3 - version: 19.2.3(@types/react@19.2.7) + version: 19.2.3(@types/react@19.2.14) '@velite/plugin-vite': specifier: workspace:* version: link:../../packages/vite '@vitejs/plugin-react': - specifier: ^5.1.2 - version: 5.1.2(vite@7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) + specifier: ^6.0.2 + version: 6.0.2(vite@8.0.13(@types/node@25.8.0)(esbuild@0.28.0)(jiti@2.6.1)(terser@5.44.1)(tsx@4.22.0)(yaml@2.9.0)) eslint: - specifier: ^9.39.2 - version: 9.39.2(jiti@2.6.1) + specifier: ^10.4.0 + version: 10.4.0(jiti@2.6.1) eslint-plugin-react-hooks: - specifier: ^7.0.1 - version: 7.0.1(eslint@9.39.2(jiti@2.6.1)) + specifier: ^7.1.1 + version: 7.1.1(eslint@10.4.0(jiti@2.6.1)) eslint-plugin-react-refresh: - specifier: ^0.4.25 - version: 0.4.25(eslint@9.39.2(jiti@2.6.1)) + specifier: ^0.5.2 + version: 0.5.2(eslint@10.4.0(jiti@2.6.1)) globals: - specifier: ^16.5.0 - version: 16.5.0 + specifier: ^17.6.0 + version: 17.6.0 rehype-pretty-code: - specifier: ^0.14.1 - version: 0.14.1(shiki@3.20.0) + specifier: ^0.14.3 + version: 0.14.3(shiki@4.0.2) shiki: - specifier: ^3.20.0 - version: 3.20.0 + specifier: ^4.0.2 + version: 4.0.2 typescript: - specifier: ^5.9.3 - version: 5.9.3 + specifier: ^6.0.3 + version: 6.0.3 typescript-eslint: - specifier: ^8.49.0 - version: 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + specifier: ^8.59.3 + version: 8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3) velite: specifier: workspace:* version: link:../.. vite: - specifier: ^7.2.7 - version: 7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + specifier: ^8.0.13 + version: 8.0.13(@types/node@25.8.0)(esbuild@0.28.0)(jiti@2.6.1)(terser@5.44.1)(tsx@4.22.0)(yaml@2.9.0) packages/next: dependencies: next: specifier: ^16.0.0 - version: 16.0.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 16.0.10(react-dom@19.2.6(react@19.2.6))(react@19.2.6) velite: specifier: workspace:* version: link:../.. @@ -245,8 +245,8 @@ importers: specifier: workspace:* version: link:../.. vite: - specifier: ^5.0.0 || ^6.0.0 || ^7.0.0 - version: 7.1.3(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) + specifier: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 + version: 8.0.13(@types/node@25.8.0)(esbuild@0.28.0)(jiti@2.6.1)(terser@5.44.1)(tsx@4.22.0)(yaml@2.9.0) packages: @@ -326,10 +326,6 @@ packages: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - '@ampproject/remapping@2.3.0': - resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} - engines: {node: '>=6.0.0'} - '@babel/code-frame@7.27.1': resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} @@ -338,10 +334,6 @@ packages: resolution: {integrity: sha512-TUtMJYRPyUb/9aU8f3K0mjmjf6M9N5Woshn2CS6nqJSeJtTtQcpLUXjGt9vbF8ZGff0El99sWkLgzwW3VXnxZQ==} engines: {node: '>=6.9.0'} - '@babel/core@7.28.3': - resolution: {integrity: sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==} - engines: {node: '>=6.9.0'} - '@babel/core@7.28.5': resolution: {integrity: sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==} engines: {node: '>=6.9.0'} @@ -368,10 +360,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-plugin-utils@7.27.1': - resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.27.1': resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} @@ -384,10 +372,6 @@ packages: resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.28.3': - resolution: {integrity: sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==} - engines: {node: '>=6.9.0'} - '@babel/helpers@7.28.4': resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==} engines: {node: '>=6.9.0'} @@ -397,18 +381,6 @@ packages: engines: {node: '>=6.0.0'} hasBin: true - '@babel/plugin-transform-react-jsx-self@7.27.1': - resolution: {integrity: sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-react-jsx-source@7.27.1': - resolution: {integrity: sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/template@7.27.2': resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} @@ -444,23 +416,32 @@ packages: search-insights: optional: true + '@emnapi/core@1.10.0': + resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} + + '@emnapi/runtime@1.10.0': + resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} + '@emnapi/runtime@1.7.1': resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==} + '@emnapi/wasi-threads@1.2.1': + resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.25.12': - resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} + '@esbuild/aix-ppc64@0.27.1': + resolution: {integrity: sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.27.1': - resolution: {integrity: sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==} + '@esbuild/aix-ppc64@0.28.0': + resolution: {integrity: sha512-lhRUCeuOyJQURhTxl4WkpFTjIsbDayJHih5kZC1giwE+MhIzAb7mEsQMqMf18rHLsrb5qI1tafG20mLxEWcWlA==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] @@ -471,14 +452,14 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.25.12': - resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==} + '@esbuild/android-arm64@0.27.1': + resolution: {integrity: sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.27.1': - resolution: {integrity: sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==} + '@esbuild/android-arm64@0.28.0': + resolution: {integrity: sha512-+WzIXQOSaGs33tLEgYPYe/yQHf0WTU0X42Jca3y8NWMbUVhp7rUnw+vAsRC/QiDrdD31IszMrZy+qwPOPjd+rw==} engines: {node: '>=18'} cpu: [arm64] os: [android] @@ -489,14 +470,14 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.25.12': - resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==} + '@esbuild/android-arm@0.27.1': + resolution: {integrity: sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-arm@0.27.1': - resolution: {integrity: sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==} + '@esbuild/android-arm@0.28.0': + resolution: {integrity: sha512-wqh0ByljabXLKHeWXYLqoJ5jKC4XBaw6Hk08OfMrCRd2nP2ZQ5eleDZC41XHyCNgktBGYMbqnrJKq/K/lzPMSQ==} engines: {node: '>=18'} cpu: [arm] os: [android] @@ -507,14 +488,14 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.25.12': - resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==} + '@esbuild/android-x64@0.27.1': + resolution: {integrity: sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/android-x64@0.27.1': - resolution: {integrity: sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==} + '@esbuild/android-x64@0.28.0': + resolution: {integrity: sha512-+VJggoaKhk2VNNqVL7f6S189UzShHC/mR9EE8rDdSkdpN0KflSwWY/gWjDrNxxisg8Fp1ZCD9jLMo4m0OUfeUA==} engines: {node: '>=18'} cpu: [x64] os: [android] @@ -525,14 +506,14 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.25.12': - resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==} + '@esbuild/darwin-arm64@0.27.1': + resolution: {integrity: sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.27.1': - resolution: {integrity: sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==} + '@esbuild/darwin-arm64@0.28.0': + resolution: {integrity: sha512-0T+A9WZm+bZ84nZBtk1ckYsOvyA3x7e2Acj1KdVfV4/2tdG4fzUp91YHx+GArWLtwqp77pBXVCPn2We7Letr0Q==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] @@ -543,14 +524,14 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.25.12': - resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==} + '@esbuild/darwin-x64@0.27.1': + resolution: {integrity: sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.27.1': - resolution: {integrity: sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==} + '@esbuild/darwin-x64@0.28.0': + resolution: {integrity: sha512-fyzLm/DLDl/84OCfp2f/XQ4flmORsjU7VKt8HLjvIXChJoFFOIL6pLJPH4Yhd1n1gGFF9mPwtlN5Wf82DZs+LQ==} engines: {node: '>=18'} cpu: [x64] os: [darwin] @@ -561,14 +542,14 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.25.12': - resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==} + '@esbuild/freebsd-arm64@0.27.1': + resolution: {integrity: sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.27.1': - resolution: {integrity: sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==} + '@esbuild/freebsd-arm64@0.28.0': + resolution: {integrity: sha512-l9GeW5UZBT9k9brBYI+0WDffcRxgHQD8ShN2Ur4xWq/NFzUKm3k5lsH4PdaRgb2w7mI9u61nr2gI2mLI27Nh3Q==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] @@ -579,14 +560,14 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.25.12': - resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==} + '@esbuild/freebsd-x64@0.27.1': + resolution: {integrity: sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.27.1': - resolution: {integrity: sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==} + '@esbuild/freebsd-x64@0.28.0': + resolution: {integrity: sha512-BXoQai/A0wPO6Es3yFJ7APCiKGc1tdAEOgeTNy3SsB491S3aHn4S4r3e976eUnPdU+NbdtmBuLncYir2tMU9Nw==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] @@ -597,14 +578,14 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.25.12': - resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==} + '@esbuild/linux-arm64@0.27.1': + resolution: {integrity: sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.27.1': - resolution: {integrity: sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==} + '@esbuild/linux-arm64@0.28.0': + resolution: {integrity: sha512-RVyzfb3FWsGA55n6WY0MEIEPURL1FcbhFE6BffZEMEekfCzCIMtB5yyDcFnVbTnwk+CLAgTujmV/Lgvih56W+A==} engines: {node: '>=18'} cpu: [arm64] os: [linux] @@ -615,14 +596,14 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.25.12': - resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==} + '@esbuild/linux-arm@0.27.1': + resolution: {integrity: sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.27.1': - resolution: {integrity: sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==} + '@esbuild/linux-arm@0.28.0': + resolution: {integrity: sha512-CjaaREJagqJp7iTaNQjjidaNbCKYcd4IDkzbwwxtSvjI7NZm79qiHc8HqciMddQ6CKvJT6aBd8lO9kN/ZudLlw==} engines: {node: '>=18'} cpu: [arm] os: [linux] @@ -633,14 +614,14 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.25.12': - resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==} + '@esbuild/linux-ia32@0.27.1': + resolution: {integrity: sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.27.1': - resolution: {integrity: sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==} + '@esbuild/linux-ia32@0.28.0': + resolution: {integrity: sha512-KBnSTt1kxl9x70q+ydterVdl+Cn0H18ngRMRCEQfrbqdUuntQQ0LoMZv47uB97NljZFzY6HcfqEZ2SAyIUTQBQ==} engines: {node: '>=18'} cpu: [ia32] os: [linux] @@ -651,14 +632,14 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.25.12': - resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==} + '@esbuild/linux-loong64@0.27.1': + resolution: {integrity: sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.27.1': - resolution: {integrity: sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==} + '@esbuild/linux-loong64@0.28.0': + resolution: {integrity: sha512-zpSlUce1mnxzgBADvxKXX5sl8aYQHo2ezvMNI8I0lbblJtp8V4odlm3Yzlj7gPyt3T8ReksE6bK+pT3WD+aJRg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] @@ -669,14 +650,14 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.25.12': - resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==} + '@esbuild/linux-mips64el@0.27.1': + resolution: {integrity: sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.27.1': - resolution: {integrity: sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==} + '@esbuild/linux-mips64el@0.28.0': + resolution: {integrity: sha512-2jIfP6mmjkdmeTlsX/9vmdmhBmKADrWqN7zcdtHIeNSCH1SqIoNI63cYsjQR8J+wGa4Y5izRcSHSm8K3QWmk3w==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] @@ -687,14 +668,14 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.25.12': - resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==} + '@esbuild/linux-ppc64@0.27.1': + resolution: {integrity: sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.27.1': - resolution: {integrity: sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==} + '@esbuild/linux-ppc64@0.28.0': + resolution: {integrity: sha512-bc0FE9wWeC0WBm49IQMPSPILRocGTQt3j5KPCA8os6VprfuJ7KD+5PzESSrJ6GmPIPJK965ZJHTUlSA6GNYEhg==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] @@ -705,14 +686,14 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.25.12': - resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==} + '@esbuild/linux-riscv64@0.27.1': + resolution: {integrity: sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.27.1': - resolution: {integrity: sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==} + '@esbuild/linux-riscv64@0.28.0': + resolution: {integrity: sha512-SQPZOwoTTT/HXFXQJG/vBX8sOFagGqvZyXcgLA3NhIqcBv1BJU1d46c0rGcrij2B56Z2rNiSLaZOYW5cUk7yLQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] @@ -723,14 +704,14 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.25.12': - resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==} + '@esbuild/linux-s390x@0.27.1': + resolution: {integrity: sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.27.1': - resolution: {integrity: sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==} + '@esbuild/linux-s390x@0.28.0': + resolution: {integrity: sha512-SCfR0HN8CEEjnYnySJTd2cw0k9OHB/YFzt5zgJEwa+wL/T/raGWYMBqwDNAC6dqFKmJYZoQBRfHjgwLHGSrn3Q==} engines: {node: '>=18'} cpu: [s390x] os: [linux] @@ -741,26 +722,26 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.25.12': - resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==} + '@esbuild/linux-x64@0.27.1': + resolution: {integrity: sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.27.1': - resolution: {integrity: sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==} + '@esbuild/linux-x64@0.28.0': + resolution: {integrity: sha512-us0dSb9iFxIi8srnpl931Nvs65it/Jd2a2K3qs7fz2WfGPHqzfzZTfec7oxZJRNPXPnNYZtanmRc4AL/JwVzHQ==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.25.12': - resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==} + '@esbuild/netbsd-arm64@0.27.1': + resolution: {integrity: sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-arm64@0.27.1': - resolution: {integrity: sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==} + '@esbuild/netbsd-arm64@0.28.0': + resolution: {integrity: sha512-CR/RYotgtCKwtftMwJlUU7xCVNg3lMYZ0RzTmAHSfLCXw3NtZtNpswLEj/Kkf6kEL3Gw+BpOekRX0BYCtklhUw==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] @@ -771,26 +752,26 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.25.12': - resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==} + '@esbuild/netbsd-x64@0.27.1': + resolution: {integrity: sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.27.1': - resolution: {integrity: sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==} + '@esbuild/netbsd-x64@0.28.0': + resolution: {integrity: sha512-nU1yhmYutL+fQ71Kxnhg8uEOdC0pwEW9entHykTgEbna2pw2dkbFSMeqjjyHZoCmt8SBkOSvV+yNmm94aUrrqw==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.25.12': - resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==} + '@esbuild/openbsd-arm64@0.27.1': + resolution: {integrity: sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-arm64@0.27.1': - resolution: {integrity: sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==} + '@esbuild/openbsd-arm64@0.28.0': + resolution: {integrity: sha512-cXb5vApOsRsxsEl4mcZ1XY3D4DzcoMxR/nnc4IyqYs0rTI8ZKmW6kyyg+11Z8yvgMfAEldKzP7AdP64HnSC/6g==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] @@ -801,26 +782,26 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.25.12': - resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==} + '@esbuild/openbsd-x64@0.27.1': + resolution: {integrity: sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.27.1': - resolution: {integrity: sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==} + '@esbuild/openbsd-x64@0.28.0': + resolution: {integrity: sha512-8wZM2qqtv9UP3mzy7HiGYNH/zjTA355mpeuA+859TyR+e+Tc08IHYpLJuMsfpDJwoLo1ikIJI8jC3GFjnRClzA==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/openharmony-arm64@0.25.12': - resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==} + '@esbuild/openharmony-arm64@0.27.1': + resolution: {integrity: sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] - '@esbuild/openharmony-arm64@0.27.1': - resolution: {integrity: sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==} + '@esbuild/openharmony-arm64@0.28.0': + resolution: {integrity: sha512-FLGfyizszcef5C3YtoyQDACyg95+dndv79i2EekILBofh5wpCa1KuBqOWKrEHZg3zrL3t5ouE5jgr94vA+Wb2w==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] @@ -831,14 +812,14 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.25.12': - resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==} + '@esbuild/sunos-x64@0.27.1': + resolution: {integrity: sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.27.1': - resolution: {integrity: sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==} + '@esbuild/sunos-x64@0.28.0': + resolution: {integrity: sha512-1ZgjUoEdHZZl/YlV76TSCz9Hqj9h9YmMGAgAPYd+q4SicWNX3G5GCyx9uhQWSLcbvPW8Ni7lj4gDa1T40akdlw==} engines: {node: '>=18'} cpu: [x64] os: [sunos] @@ -849,14 +830,14 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.25.12': - resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==} + '@esbuild/win32-arm64@0.27.1': + resolution: {integrity: sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.27.1': - resolution: {integrity: sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==} + '@esbuild/win32-arm64@0.28.0': + resolution: {integrity: sha512-Q9StnDmQ/enxnpxCCLSg0oo4+34B9TdXpuyPeTedN/6+iXBJ4J+zwfQI28u/Jl40nOYAxGoNi7mFP40RUtkmUA==} engines: {node: '>=18'} cpu: [arm64] os: [win32] @@ -867,14 +848,14 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.25.12': - resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==} + '@esbuild/win32-ia32@0.27.1': + resolution: {integrity: sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.27.1': - resolution: {integrity: sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==} + '@esbuild/win32-ia32@0.28.0': + resolution: {integrity: sha512-zF3ag/gfiCe6U2iczcRzSYJKH1DCI+ByzSENHlM2FcDbEeo5Zd2C86Aq0tKUYAJJ1obRP84ymxIAksZUcdztHA==} engines: {node: '>=18'} cpu: [ia32] os: [win32] @@ -885,61 +866,62 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.25.12': - resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==} + '@esbuild/win32-x64@0.27.1': + resolution: {integrity: sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.27.1': - resolution: {integrity: sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==} + '@esbuild/win32-x64@0.28.0': + resolution: {integrity: sha512-pEl1bO9mfAmIC+tW5btTmrKaujg3zGtUmWNdCw/xs70FBjwAL3o9OEKNHvNmnyylD6ubxUERiEhdsL0xBQ9efw==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.7.0': - resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==} + '@eslint-community/eslint-utils@4.9.0': + resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/eslint-utils@4.9.0': - resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} + '@eslint-community/eslint-utils@4.9.1': + resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.12.1': - resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.21.1': - resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-array@0.23.5': + resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/config-helpers@0.4.2': - resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/core@0.17.0': - resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-helpers@0.6.0': + resolution: {integrity: sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/eslintrc@3.3.1': - resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@1.2.1': + resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/js@9.39.2': - resolution: {integrity: sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@10.0.1': + resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^10.0.0 + peerDependenciesMeta: + eslint: + optional: true - '@eslint/object-schema@2.1.7': - resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/object-schema@3.0.5': + resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/plugin-kit@0.4.1': - resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/plugin-kit@0.7.1': + resolution: {integrity: sha512-rZAP3aVgB9ds9KOeUSL+zZ21hPmo8dh6fnIFwRQj5EAZl9gzR7wxYbYXYysAM8CTqGmUGyp2S4kUdV17MnGuWQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} @@ -1015,89 +997,105 @@ packages: resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.4': resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.4': resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.2.4': resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} cpu: [riscv64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.4': resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.4': resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.4': resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.4': resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-linux-arm64@0.34.5': resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-linux-arm@0.34.5': resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-linux-ppc64@0.34.5': resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-linux-riscv64@0.34.5': resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@img/sharp-linux-s390x@0.34.5': resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-linux-x64@0.34.5': resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.5': resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-x64@0.34.5': resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-wasm32@0.34.5': resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} @@ -1147,44 +1145,97 @@ packages: '@mdx-js/mdx@3.1.1': resolution: {integrity: sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==} + '@napi-rs/wasm-runtime@1.1.4': + resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + '@next/env@16.0.10': resolution: {integrity: sha512-8tuaQkyDVgeONQ1MeT9Mkk8pQmZapMKFh5B+OrFUlG3rVmYTXcXlBetBgTurKXGaIZvkoqRT9JL5K3phXcgang==} + '@next/env@16.2.6': + resolution: {integrity: sha512-gd8HoHN4ufj73WmR3JmVolrpJR47ILK6LouP5xElPglaVxir6e1a7VzvTvDWkOoPXT9rkkTzyCxBu4yeZfZwcw==} + '@next/swc-darwin-arm64@16.0.10': resolution: {integrity: sha512-4XgdKtdVsaflErz+B5XeG0T5PeXKDdruDf3CRpnhN+8UebNa5N2H58+3GDgpn/9GBurrQ1uWW768FfscwYkJRg==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] + '@next/swc-darwin-arm64@16.2.6': + resolution: {integrity: sha512-ZJGkkcNfYgrrMkqOdZ7zoLa1TOy0qpcMfk/z4Mh/FKUz40gVO+HNQWqmLxf67Z5WB64DRp0dhEbyHfel+6sJUg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + '@next/swc-darwin-x64@16.0.10': resolution: {integrity: sha512-spbEObMvRKkQ3CkYVOME+ocPDFo5UqHb8EMTS78/0mQ+O1nqE8toHJVioZo4TvebATxgA8XMTHHrScPrn68OGw==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] + '@next/swc-darwin-x64@16.2.6': + resolution: {integrity: sha512-v/YLBHIY132Ced3puBJ7YJKw1lqsCrgcNo2aRJlCEyQrrCeRJlvGlnmxhPxNQI3KE3N1DN5r9TPNPvka3nq5RQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + '@next/swc-linux-arm64-gnu@16.0.10': resolution: {integrity: sha512-uQtWE3X0iGB8apTIskOMi2w/MKONrPOUCi5yLO+v3O8Mb5c7K4Q5KD1jvTpTF5gJKa3VH/ijKjKUq9O9UhwOYw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] + + '@next/swc-linux-arm64-gnu@16.2.6': + resolution: {integrity: sha512-RPOvqlYBbcQjkz9VQQDZ2T2bARIjXZV1KFlt+V2Mr6SW/e4I9fcKsaA0hdyf2FHoTlsV2xnBd5Y912rP/1Ce6w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] '@next/swc-linux-arm64-musl@16.0.10': resolution: {integrity: sha512-llA+hiDTrYvyWI21Z0L1GiXwjQaanPVQQwru5peOgtooeJ8qx3tlqRV2P7uH2pKQaUfHxI/WVarvI5oYgGxaTw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] + + '@next/swc-linux-arm64-musl@16.2.6': + resolution: {integrity: sha512-URUTu1+dMkxJsPFgm+OeEvq9wf5sujw0EvgYy80TDGHTSLTnIHeqb0Eu8A3sC95IRgjejQL+kC4mw+4yPxiAXA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] '@next/swc-linux-x64-gnu@16.0.10': resolution: {integrity: sha512-AK2q5H0+a9nsXbeZ3FZdMtbtu9jxW4R/NgzZ6+lrTm3d6Zb7jYrWcgjcpM1k8uuqlSy4xIyPR2YiuUr+wXsavA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] + + '@next/swc-linux-x64-gnu@16.2.6': + resolution: {integrity: sha512-DOj182mPV8G3UkrayLoREM5YEYI+Dk5wv7Ox9xl1fFibAELEsFD0lDPfHIeILlutMMfdyhlzYPELG3peuKaurw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] '@next/swc-linux-x64-musl@16.0.10': resolution: {integrity: sha512-1TDG9PDKivNw5550S111gsO4RGennLVl9cipPhtkXIFVwo31YZ73nEbLjNC8qG3SgTz/QZyYyaFYMeY4BKZR/g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] + + '@next/swc-linux-x64-musl@16.2.6': + resolution: {integrity: sha512-HKQ5SP/V/ub73UvF7n/zeJlxk2kLmtL7Wzrg4WfmkjmNos5onJ2tKu7yZOPdL18A6Svfn3max29ym+ry7NkK4g==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] '@next/swc-win32-arm64-msvc@16.0.10': resolution: {integrity: sha512-aEZIS4Hh32xdJQbHz121pyuVZniSNoqDVx1yIr2hy+ZwJGipeqnMZBJHyMxv2tiuAXGx6/xpTcQJ6btIiBjgmg==} @@ -1192,12 +1243,24 @@ packages: cpu: [arm64] os: [win32] + '@next/swc-win32-arm64-msvc@16.2.6': + resolution: {integrity: sha512-LZXpTlPyS5v7HhSmnvsLGP3iIYgYOBnc8r8ArlT55sGHV89bR2HlDdBjWQ+PY6SJMmk8TuVGFuxalnP3k/0Dwg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + '@next/swc-win32-x64-msvc@16.0.10': resolution: {integrity: sha512-E+njfCoFLb01RAFEnGZn6ERoOqhK1Gl3Lfz1Kjnj0Ulfu7oJbuMyvBKNj/bw8XZnenHDASlygTjZICQW+rYW1Q==} engines: {node: '>= 10'} cpu: [x64] os: [win32] + '@next/swc-win32-x64-msvc@16.2.6': + resolution: {integrity: sha512-F0+4i0h9J6C4eE3EAPWsoCk7UW/dbzOjyzxY0qnDUOYFu6FFmdZ6l97/XdV3/Nz3VYyO7UWjyEJUXkGqcoXfMA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1210,16 +1273,109 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@rolldown/pluginutils@1.0.0-beta.53': - resolution: {integrity: sha512-vENRlFU4YbrwVqNDZ7fLvy+JR1CRkyr01jhSiDpE1u6py3OMzQfztQU2jxykW3ALNxO4kSlqIDeYyD0Y9RcQeQ==} + '@oxc-project/types@0.130.0': + resolution: {integrity: sha512-ibD2usx9JRu7f5pu2tMKMI4cpA4NgXJQoYRP4pQ7Pxmn1l6k/53qWtQWZayhYy3X4QZkt90Ot+mJEaeXouio6Q==} - '@rollup/rollup-android-arm-eabi@4.41.0': - resolution: {integrity: sha512-KxN+zCjOYHGwCl4UCtSfZ6jrq/qi88JDUtiEFk8LELEHq2Egfc/FgW+jItZiOLRuQfb/3xJSgFuNPC9jzggX+A==} - cpu: [arm] + '@rolldown/binding-android-arm64@1.0.1': + resolution: {integrity: sha512-fJI3I0r3C3Oj/zdBCpaCmBRZYf07xpaq4yCfDDoSFm+beWNzbIl26puW8RraUdugoJw/95zerNOn6jasAhzSmg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] os: [android] - '@rollup/rollup-android-arm-eabi@4.48.1': - resolution: {integrity: sha512-rGmb8qoG/zdmKoYELCBwu7vt+9HxZ7Koos3pD0+sH5fR3u3Wb/jGcpnqxcnWsPEKDUyzeLSqksN8LJtgXjqBYw==} + '@rolldown/binding-darwin-arm64@1.0.1': + resolution: {integrity: sha512-cKnAhWEsV7TPcA/5EAteDp6KcJZBQ2G+BqE7zayMMi7kMvwRsbv7WT9aOnn0WNl4SKEIf43vjS31iUPu80nzXg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.1': + resolution: {integrity: sha512-YKrVwQjIRBPo+5G/u03wGjbdy4q7pyzCe93DK9VJ7zkVmeg8LJ7GbgsiHWdR4xSoe4CAXRD7Bcjgbtr64bkXNg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.1': + resolution: {integrity: sha512-z/oBsREo46SsFqBwYtFe0kpJeBijAT48O/WXLI4suiCLBkr03RTtTJMCzSdDd2znlh8VJizL09XVkQgk8IZonw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.1': + resolution: {integrity: sha512-ik8q7GM11zxvYxFc2PeDcT6TBvhCQMaUxfph/M5l9sKuTs/Sjg3L+Byw0F7w0ZVLBZmx30P+gG0ECzzN+MFcmQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.1': + resolution: {integrity: sha512-QoSx2EkyrrdZ6kcyE8stqZ62t0Yra8Fs5ia9lOxJrh6TMQJK7gQKmscdTHf7pOXKREKrVwOtJcQG3qVSfc866A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.0.1': + resolution: {integrity: sha512-uwNwFpwKeNiZawfAWBgg0VIztPTV3ihhh1vV334h9ivnNLorxnQMU6Fz8wG1Zb4Qh9LC1/MkcyT3YlDXG3Rsgg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.0.1': + resolution: {integrity: sha512-zY1bul7OWr7DFBiJ++wofXvnr8B45ce3QsQUhKrIhXsygAh7bTkwyeM1bi1a2g5C/yC/N8TZyGDEoMfm/l9mpg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.1': + resolution: {integrity: sha512-0frlsT/f4Ft6I7SMESTKnF3cZsdicQn1dCMkF/jT9wDLE+gGoiQfv1nmT9e+s7s/fekvvy6tZM2jHvI2tkbJDQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.0.1': + resolution: {integrity: sha512-XABVmGp9Tg0WspTVvwduTc4fpqy6JnAUrSQe6OuyqD/03nI7r0O9OWUkMIwFrjKAIqolvqoA4ZrJppgwE0Gxmw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.0.1': + resolution: {integrity: sha512-bV4fzswuzVcKD90o/VM6QqKxnxlDq0g2BISDLNVmxrnhpv1DDbyPhCIjYfvzYLV+MvkKKnQt2Q6AO86SEBULUQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.0.1': + resolution: {integrity: sha512-/Mh0Zhq3OP7fVs0kcQHZP6lZEthMGTaSf8UBQYSFEZDWGXXlEC+nJ6EqenaK2t4LBXMe3A+K/G2BVXXdtOr4PQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.1': + resolution: {integrity: sha512-+1xc9X45l8ufsBAm6Gjvx2qDRIY9lTVt0cgWNcJ+1gdhXvkbxePA60yRTwSTuXL09CMhyJmjpV7E3NoyxbqFQQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.1': + resolution: {integrity: sha512-1D+UqZdfnuR+Jy1GgMJwi85bD40H21uNmOPRWQhw4oRSuolZ/B5rixZ45DK2KXOTCvmVCecauWgEhbw8bI7tOw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.1': + resolution: {integrity: sha512-INAycaWuhlOK3wk4mRHGsdgwYWmd9cChdPdE9bwWmy6rn9VqVNYNFGhOdXrofXUxwHIncSiPNb8tNm8knDVIeQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@rollup/rollup-android-arm-eabi@4.41.0': + resolution: {integrity: sha512-KxN+zCjOYHGwCl4UCtSfZ6jrq/qi88JDUtiEFk8LELEHq2Egfc/FgW+jItZiOLRuQfb/3xJSgFuNPC9jzggX+A==} cpu: [arm] os: [android] @@ -1233,11 +1389,6 @@ packages: cpu: [arm64] os: [android] - '@rollup/rollup-android-arm64@4.48.1': - resolution: {integrity: sha512-4e9WtTxrk3gu1DFE+imNJr4WsL13nWbD/Y6wQcyku5qadlKHY3OQ3LJ/INrrjngv2BJIHnIzbqMk1GTAC2P8yQ==} - cpu: [arm64] - os: [android] - '@rollup/rollup-android-arm64@4.53.3': resolution: {integrity: sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==} cpu: [arm64] @@ -1248,11 +1399,6 @@ packages: cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-arm64@4.48.1': - resolution: {integrity: sha512-+XjmyChHfc4TSs6WUQGmVf7Hkg8ferMAE2aNYYWjiLzAS/T62uOsdfnqv+GHRjq7rKRnYh4mwWb4Hz7h/alp8A==} - cpu: [arm64] - os: [darwin] - '@rollup/rollup-darwin-arm64@4.53.3': resolution: {integrity: sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==} cpu: [arm64] @@ -1263,11 +1409,6 @@ packages: cpu: [x64] os: [darwin] - '@rollup/rollup-darwin-x64@4.48.1': - resolution: {integrity: sha512-upGEY7Ftw8M6BAJyGwnwMw91rSqXTcOKZnnveKrVWsMTF8/k5mleKSuh7D4v4IV1pLxKAk3Tbs0Lo9qYmii5mQ==} - cpu: [x64] - os: [darwin] - '@rollup/rollup-darwin-x64@4.53.3': resolution: {integrity: sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==} cpu: [x64] @@ -1278,23 +1419,13 @@ packages: cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-arm64@4.48.1': - resolution: {integrity: sha512-P9ViWakdoynYFUOZhqq97vBrhuvRLAbN/p2tAVJvhLb8SvN7rbBnJQcBu8e/rQts42pXGLVhfsAP0k9KXWa3nQ==} - cpu: [arm64] - os: [freebsd] - '@rollup/rollup-freebsd-arm64@4.53.3': resolution: {integrity: sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==} cpu: [arm64] os: [freebsd] '@rollup/rollup-freebsd-x64@4.41.0': - resolution: {integrity: sha512-KGiGKGDg8qLRyOWmk6IeiHJzsN/OYxO6nSbT0Vj4MwjS2XQy/5emsmtoqLAabqrohbgLWJ5GV3s/ljdrIr8Qjg==} - cpu: [x64] - os: [freebsd] - - '@rollup/rollup-freebsd-x64@4.48.1': - resolution: {integrity: sha512-VLKIwIpnBya5/saccM8JshpbxfyJt0Dsli0PjXozHwbSVaHTvWXJH1bbCwPXxnMzU4zVEfgD1HpW3VQHomi2AQ==} + resolution: {integrity: sha512-KGiGKGDg8qLRyOWmk6IeiHJzsN/OYxO6nSbT0Vj4MwjS2XQy/5emsmtoqLAabqrohbgLWJ5GV3s/ljdrIr8Qjg==} cpu: [x64] os: [freebsd] @@ -1307,166 +1438,133 @@ packages: resolution: {integrity: sha512-46OzWeqEVQyX3N2/QdiU/CMXYDH/lSHpgfBkuhl3igpZiaB3ZIfSjKuOnybFVBQzjsLwkus2mjaESy8H41SzvA==} cpu: [arm] os: [linux] - - '@rollup/rollup-linux-arm-gnueabihf@4.48.1': - resolution: {integrity: sha512-3zEuZsXfKaw8n/yF7t8N6NNdhyFw3s8xJTqjbTDXlipwrEHo4GtIKcMJr5Ed29leLpB9AugtAQpAHW0jvtKKaQ==} - cpu: [arm] - os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-gnueabihf@4.53.3': resolution: {integrity: sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.41.0': resolution: {integrity: sha512-lfgW3KtQP4YauqdPpcUZHPcqQXmTmH4nYU0cplNeW583CMkAGjtImw4PKli09NFi2iQgChk4e9erkwlfYem6Lg==} cpu: [arm] os: [linux] - - '@rollup/rollup-linux-arm-musleabihf@4.48.1': - resolution: {integrity: sha512-leo9tOIlKrcBmmEypzunV/2w946JeLbTdDlwEZ7OnnsUyelZ72NMnT4B2vsikSgwQifjnJUbdXzuW4ToN1wV+Q==} - cpu: [arm] - os: [linux] + libc: [musl] '@rollup/rollup-linux-arm-musleabihf@4.53.3': resolution: {integrity: sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.41.0': resolution: {integrity: sha512-nn8mEyzMbdEJzT7cwxgObuwviMx6kPRxzYiOl6o/o+ChQq23gfdlZcUNnt89lPhhz3BYsZ72rp0rxNqBSfqlqw==} cpu: [arm64] os: [linux] - - '@rollup/rollup-linux-arm64-gnu@4.48.1': - resolution: {integrity: sha512-Vy/WS4z4jEyvnJm+CnPfExIv5sSKqZrUr98h03hpAMbE2aI0aD2wvK6GiSe8Gx2wGp3eD81cYDpLLBqNb2ydwQ==} - cpu: [arm64] - os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-gnu@4.53.3': resolution: {integrity: sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.41.0': resolution: {integrity: sha512-l+QK99je2zUKGd31Gh+45c4pGDAqZSuWQiuRFCdHYC2CSiO47qUWsCcenrI6p22hvHZrDje9QjwSMAFL3iwXwQ==} cpu: [arm64] os: [linux] - - '@rollup/rollup-linux-arm64-musl@4.48.1': - resolution: {integrity: sha512-x5Kzn7XTwIssU9UYqWDB9VpLpfHYuXw5c6bJr4Mzv9kIv242vmJHbI5PJJEnmBYitUIfoMCODDhR7KoZLot2VQ==} - cpu: [arm64] - os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-musl@4.53.3': resolution: {integrity: sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.53.3': resolution: {integrity: sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-loongarch64-gnu@4.41.0': resolution: {integrity: sha512-WbnJaxPv1gPIm6S8O/Wg+wfE/OzGSXlBMbOe4ie+zMyykMOeqmgD1BhPxZQuDqwUN+0T/xOFtL2RUWBspnZj3w==} cpu: [loong64] os: [linux] - - '@rollup/rollup-linux-loongarch64-gnu@4.48.1': - resolution: {integrity: sha512-yzCaBbwkkWt/EcgJOKDUdUpMHjhiZT/eDktOPWvSRpqrVE04p0Nd6EGV4/g7MARXXeOqstflqsKuXVM3H9wOIQ==} - cpu: [loong64] - os: [linux] + libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.41.0': resolution: {integrity: sha512-eRDWR5t67/b2g8Q/S8XPi0YdbKcCs4WQ8vklNnUYLaSWF+Cbv2axZsp4jni6/j7eKvMLYCYdcsv8dcU+a6QNFg==} cpu: [ppc64] os: [linux] - - '@rollup/rollup-linux-ppc64-gnu@4.48.1': - resolution: {integrity: sha512-UK0WzWUjMAJccHIeOpPhPcKBqax7QFg47hwZTp6kiMhQHeOYJeaMwzeRZe1q5IiTKsaLnHu9s6toSYVUlZ2QtQ==} - cpu: [ppc64] - os: [linux] + libc: [glibc] '@rollup/rollup-linux-ppc64-gnu@4.53.3': resolution: {integrity: sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.41.0': resolution: {integrity: sha512-TWrZb6GF5jsEKG7T1IHwlLMDRy2f3DPqYldmIhnA2DVqvvhY2Ai184vZGgahRrg8k9UBWoSlHv+suRfTN7Ua4A==} cpu: [riscv64] os: [linux] - - '@rollup/rollup-linux-riscv64-gnu@4.48.1': - resolution: {integrity: sha512-3NADEIlt+aCdCbWVZ7D3tBjBX1lHpXxcvrLt/kdXTiBrOds8APTdtk2yRL2GgmnSVeX4YS1JIf0imFujg78vpw==} - cpu: [riscv64] - os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.53.3': resolution: {integrity: sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.41.0': resolution: {integrity: sha512-ieQljaZKuJpmWvd8gW87ZmSFwid6AxMDk5bhONJ57U8zT77zpZ/TPKkU9HpnnFrM4zsgr4kiGuzbIbZTGi7u9A==} cpu: [riscv64] os: [linux] - - '@rollup/rollup-linux-riscv64-musl@4.48.1': - resolution: {integrity: sha512-euuwm/QTXAMOcyiFCcrx0/S2jGvFlKJ2Iro8rsmYL53dlblp3LkUQVFzEidHhvIPPvcIsxDhl2wkBE+I6YVGzA==} - cpu: [riscv64] - os: [linux] + libc: [musl] '@rollup/rollup-linux-riscv64-musl@4.53.3': resolution: {integrity: sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==} cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.41.0': resolution: {integrity: sha512-/L3pW48SxrWAlVsKCN0dGLB2bi8Nv8pr5S5ocSM+S0XCn5RCVCXqi8GVtHFsOBBCSeR+u9brV2zno5+mg3S4Aw==} cpu: [s390x] os: [linux] - - '@rollup/rollup-linux-s390x-gnu@4.48.1': - resolution: {integrity: sha512-w8mULUjmPdWLJgmTYJx/W6Qhln1a+yqvgwmGXcQl2vFBkWsKGUBRbtLRuKJUln8Uaimf07zgJNxOhHOvjSQmBQ==} - cpu: [s390x] - os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.53.3': resolution: {integrity: sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.41.0': resolution: {integrity: sha512-XMLeKjyH8NsEDCRptf6LO8lJk23o9wvB+dJwcXMaH6ZQbbkHu2dbGIUindbMtRN6ux1xKi16iXWu6q9mu7gDhQ==} cpu: [x64] os: [linux] - - '@rollup/rollup-linux-x64-gnu@4.48.1': - resolution: {integrity: sha512-90taWXCWxTbClWuMZD0DKYohY1EovA+W5iytpE89oUPmT5O1HFdf8cuuVIylE6vCbrGdIGv85lVRzTcpTRZ+kA==} - cpu: [x64] - os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.53.3': resolution: {integrity: sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.41.0': resolution: {integrity: sha512-m/P7LycHZTvSQeXhFmgmdqEiTqSV80zn6xHaQ1JSqwCtD1YGtwEK515Qmy9DcB2HK4dOUVypQxvhVSy06cJPEg==} cpu: [x64] os: [linux] - - '@rollup/rollup-linux-x64-musl@4.48.1': - resolution: {integrity: sha512-2Gu29SkFh1FfTRuN1GR1afMuND2GKzlORQUP3mNMJbqdndOg7gNsa81JnORctazHRokiDzQ5+MLE5XYmZW5VWg==} - cpu: [x64] - os: [linux] + libc: [musl] '@rollup/rollup-linux-x64-musl@4.53.3': resolution: {integrity: sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-openharmony-arm64@4.53.3': resolution: {integrity: sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==} @@ -1478,11 +1576,6 @@ packages: cpu: [arm64] os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.48.1': - resolution: {integrity: sha512-6kQFR1WuAO50bxkIlAVeIYsz3RUx+xymwhTo9j94dJ+kmHe9ly7muH23sdfWduD0BA8pD9/yhonUvAjxGh34jQ==} - cpu: [arm64] - os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.53.3': resolution: {integrity: sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==} cpu: [arm64] @@ -1493,11 +1586,6 @@ packages: cpu: [ia32] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.48.1': - resolution: {integrity: sha512-RUyZZ/mga88lMI3RlXFs4WQ7n3VyU07sPXmMG7/C1NOi8qisUg57Y7LRarqoGoAiopmGmChUhSwfpvQ3H5iGSQ==} - cpu: [ia32] - os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.53.3': resolution: {integrity: sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==} cpu: [ia32] @@ -1513,11 +1601,6 @@ packages: cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.48.1': - resolution: {integrity: sha512-8a/caCUN4vkTChxkaIJcMtwIVcBhi4X2PQRoT+yCK3qRYaZ7cURrmJFL5Ux9H9RaMIXj9RuihckdmkBX3zZsgg==} - cpu: [x64] - os: [win32] - '@rollup/rollup-win32-x64-msvc@4.53.3': resolution: {integrity: sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==} cpu: [x64] @@ -1529,8 +1612,9 @@ packages: '@shikijs/core@2.5.0': resolution: {integrity: sha512-uu/8RExTKtavlpH7XqnVYBrfBkUc20ngXiX9NSrBhOVZYv/7XQRKUyhtkeflY5QsxC0GbJThCerruZfsUaSldg==} - '@shikijs/core@3.20.0': - resolution: {integrity: sha512-f2ED7HYV4JEk827mtMDwe/yQ25pRiXZmtHjWF8uzZKuKiEsJR7Ce1nuQ+HhV9FzDcbIo4ObBCD9GPTzNuy9S1g==} + '@shikijs/core@4.0.2': + resolution: {integrity: sha512-hxT0YF4ExEqB8G/qFdtJvpmHXBYJ2lWW7qTHDarVkIudPFE6iCIrqdgWxGn5s+ppkGXI0aEGlibI0PAyzP3zlw==} + engines: {node: '>=20'} '@shikijs/engine-javascript@2.1.0': resolution: {integrity: sha512-cgIUdAliOsoaa0rJz/z+jvhrpRd+fVAoixVFEVxUq5FA+tHgBZAIfVJSgJNVRj2hs/wZ1+4hMe82eKAThVh0nQ==} @@ -1538,8 +1622,9 @@ packages: '@shikijs/engine-javascript@2.5.0': resolution: {integrity: sha512-VjnOpnQf8WuCEZtNUdjjwGUbtAVKuZkVQ/5cHy/tojVVRIRtlWMYVjyWhxOmIq05AlSOv72z7hRNRGVBgQOl0w==} - '@shikijs/engine-javascript@3.20.0': - resolution: {integrity: sha512-OFx8fHAZuk7I42Z9YAdZ95To6jDePQ9Rnfbw9uSRTSbBhYBp1kEOKv/3jOimcj3VRUKusDYM6DswLauwfhboLg==} + '@shikijs/engine-javascript@4.0.2': + resolution: {integrity: sha512-7PW0Nm49DcoUIQEXlJhNNBHyoGMjalRETTCcjMqEaMoJRLljy1Bi/EGV3/qLBgLKQejdspiiYuHGQW6dX94Nag==} + engines: {node: '>=20'} '@shikijs/engine-oniguruma@2.1.0': resolution: {integrity: sha512-Ujik33wEDqgqY2WpjRDUBECGcKPv3eGGkoXPujIXvokLaRmGky8NisSk8lHUGeSFxo/Cz5sgFej9sJmA9yeepg==} @@ -1547,20 +1632,27 @@ packages: '@shikijs/engine-oniguruma@2.5.0': resolution: {integrity: sha512-pGd1wRATzbo/uatrCIILlAdFVKdxImWJGQ5rFiB5VZi2ve5xj3Ax9jny8QvkaV93btQEwR/rSz5ERFpC5mKNIw==} - '@shikijs/engine-oniguruma@3.20.0': - resolution: {integrity: sha512-Yx3gy7xLzM0ZOjqoxciHjA7dAt5tyzJE3L4uQoM83agahy+PlW244XJSrmJRSBvGYELDhYXPacD4R/cauV5bzQ==} + '@shikijs/engine-oniguruma@4.0.2': + resolution: {integrity: sha512-UpCB9Y2sUKlS9z8juFSKz7ZtysmeXCgnRF0dlhXBkmQnek7lAToPte8DkxmEYGNTMii72zU/lyXiCB6StuZeJg==} + engines: {node: '>=20'} '@shikijs/langs@2.5.0': resolution: {integrity: sha512-Qfrrt5OsNH5R+5tJ/3uYBBZv3SuGmnRPejV9IlIbFH3HTGLDlkqgHymAlzklVmKBjAaVmkPkyikAV/sQ1wSL+w==} - '@shikijs/langs@3.20.0': - resolution: {integrity: sha512-le+bssCxcSHrygCWuOrYJHvjus6zhQ2K7q/0mgjiffRbkhM4o1EWu2m+29l0yEsHDbWaWPNnDUTRVVBvBBeKaA==} + '@shikijs/langs@4.0.2': + resolution: {integrity: sha512-KaXby5dvoeuZzN0rYQiPMjFoUrz4hgwIE+D6Du9owcHcl6/g16/yT5BQxSW5cGt2MZBz6Hl0YuRqf12omRfUUg==} + engines: {node: '>=20'} + + '@shikijs/primitive@4.0.2': + resolution: {integrity: sha512-M6UMPrSa3fN5ayeJwFVl9qWofl273wtK1VG8ySDZ1mQBfhCpdd8nEx7nPZ/tk7k+TYcpqBZzj/AnwxT9lO+HJw==} + engines: {node: '>=20'} '@shikijs/themes@2.5.0': resolution: {integrity: sha512-wGrk+R8tJnO0VMzmUExHR+QdSaPUl/NKs+a4cQQRWyoc3YFbUzuLEi/KWK1hj+8BfHRKm2jNhhJck1dfstJpiw==} - '@shikijs/themes@3.20.0': - resolution: {integrity: sha512-U1NSU7Sl26Q7ErRvJUouArxfM2euWqq1xaSrbqMu2iqa+tSp0D1Yah8216sDYbdDHw4C8b75UpE65eWorm2erQ==} + '@shikijs/themes@4.0.2': + resolution: {integrity: sha512-mjCafwt8lJJaVSsQvNVrJumbnnj1RI8jbUKrPKgE6E3OvQKxnuRoBaYC51H4IGHePsGN/QtALglWBU7DoKDFnA==} + engines: {node: '>=20'} '@shikijs/transformers@2.1.0': resolution: {integrity: sha512-3sfvh6OKUVkT5wZFU1xxiq1qqNIuCwUY3yOb9ZGm19y80UZ/eoroLE2orGNzfivyTxR93GfXXZC/ghPR0/SBow==} @@ -1571,8 +1663,9 @@ packages: '@shikijs/types@2.5.0': resolution: {integrity: sha512-ygl5yhxki9ZLNuNpPitBWvcy9fsSKKaRuO4BAlMyagszQidxcpLAr0qiW/q43DtSIDxO6hEbtYLiFZNXO/hdGw==} - '@shikijs/types@3.20.0': - resolution: {integrity: sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw==} + '@shikijs/types@4.0.2': + resolution: {integrity: sha512-qzbeRooUTPnLE+sHD/Z8DStmaDgnbbc/pMrU203950aRqjX/6AFHeDYT+j00y2lPdz0ywJKx7o/7qnqTivtlXg==} + engines: {node: '>=20'} '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} @@ -1580,65 +1673,69 @@ packages: '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} - '@tailwindcss/node@4.1.18': - resolution: {integrity: sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ==} + '@tailwindcss/node@4.3.0': + resolution: {integrity: sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g==} - '@tailwindcss/oxide-android-arm64@4.1.18': - resolution: {integrity: sha512-dJHz7+Ugr9U/diKJA0W6N/6/cjI+ZTAoxPf9Iz9BFRF2GzEX8IvXxFIi/dZBloVJX/MZGvRuFA9rqwdiIEZQ0Q==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-android-arm64@4.3.0': + resolution: {integrity: sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng==} + engines: {node: '>= 20'} cpu: [arm64] os: [android] - '@tailwindcss/oxide-darwin-arm64@4.1.18': - resolution: {integrity: sha512-Gc2q4Qhs660bhjyBSKgq6BYvwDz4G+BuyJ5H1xfhmDR3D8HnHCmT/BSkvSL0vQLy/nkMLY20PQ2OoYMO15Jd0A==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-darwin-arm64@4.3.0': + resolution: {integrity: sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ==} + engines: {node: '>= 20'} cpu: [arm64] os: [darwin] - '@tailwindcss/oxide-darwin-x64@4.1.18': - resolution: {integrity: sha512-FL5oxr2xQsFrc3X9o1fjHKBYBMD1QZNyc1Xzw/h5Qu4XnEBi3dZn96HcHm41c/euGV+GRiXFfh2hUCyKi/e+yw==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-darwin-x64@4.3.0': + resolution: {integrity: sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA==} + engines: {node: '>= 20'} cpu: [x64] os: [darwin] - '@tailwindcss/oxide-freebsd-x64@4.1.18': - resolution: {integrity: sha512-Fj+RHgu5bDodmV1dM9yAxlfJwkkWvLiRjbhuO2LEtwtlYlBgiAT4x/j5wQr1tC3SANAgD+0YcmWVrj8R9trVMA==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-freebsd-x64@4.3.0': + resolution: {integrity: sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ==} + engines: {node: '>= 20'} cpu: [x64] os: [freebsd] - '@tailwindcss/oxide-linux-arm-gnueabihf@4.1.18': - resolution: {integrity: sha512-Fp+Wzk/Ws4dZn+LV2Nqx3IilnhH51YZoRaYHQsVq3RQvEl+71VGKFpkfHrLM/Li+kt5c0DJe/bHXK1eHgDmdiA==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0': + resolution: {integrity: sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA==} + engines: {node: '>= 20'} cpu: [arm] os: [linux] - '@tailwindcss/oxide-linux-arm64-gnu@4.1.18': - resolution: {integrity: sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-linux-arm64-gnu@4.3.0': + resolution: {integrity: sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg==} + engines: {node: '>= 20'} cpu: [arm64] os: [linux] + libc: [glibc] - '@tailwindcss/oxide-linux-arm64-musl@4.1.18': - resolution: {integrity: sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-linux-arm64-musl@4.3.0': + resolution: {integrity: sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ==} + engines: {node: '>= 20'} cpu: [arm64] os: [linux] + libc: [musl] - '@tailwindcss/oxide-linux-x64-gnu@4.1.18': - resolution: {integrity: sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-linux-x64-gnu@4.3.0': + resolution: {integrity: sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ==} + engines: {node: '>= 20'} cpu: [x64] os: [linux] + libc: [glibc] - '@tailwindcss/oxide-linux-x64-musl@4.1.18': - resolution: {integrity: sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-linux-x64-musl@4.3.0': + resolution: {integrity: sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg==} + engines: {node: '>= 20'} cpu: [x64] os: [linux] + libc: [musl] - '@tailwindcss/oxide-wasm32-wasi@4.1.18': - resolution: {integrity: sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==} + '@tailwindcss/oxide-wasm32-wasi@4.3.0': + resolution: {integrity: sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA==} engines: {node: '>=14.0.0'} cpu: [wasm32] bundledDependencies: @@ -1649,45 +1746,39 @@ packages: - '@emnapi/wasi-threads' - tslib - '@tailwindcss/oxide-win32-arm64-msvc@4.1.18': - resolution: {integrity: sha512-HjSA7mr9HmC8fu6bdsZvZ+dhjyGCLdotjVOgLA2vEqxEBZaQo9YTX4kwgEvPCpRh8o4uWc4J/wEoFzhEmjvPbA==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-win32-arm64-msvc@4.3.0': + resolution: {integrity: sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ==} + engines: {node: '>= 20'} cpu: [arm64] os: [win32] - '@tailwindcss/oxide-win32-x64-msvc@4.1.18': - resolution: {integrity: sha512-bJWbyYpUlqamC8dpR7pfjA0I7vdF6t5VpUGMWRkXVE3AXgIZjYUYAK7II1GNaxR8J1SSrSrppRar8G++JekE3Q==} - engines: {node: '>= 10'} + '@tailwindcss/oxide-win32-x64-msvc@4.3.0': + resolution: {integrity: sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA==} + engines: {node: '>= 20'} cpu: [x64] os: [win32] - '@tailwindcss/oxide@4.1.18': - resolution: {integrity: sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A==} - engines: {node: '>= 10'} + '@tailwindcss/oxide@4.3.0': + resolution: {integrity: sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==} + engines: {node: '>= 20'} - '@tailwindcss/postcss@4.1.18': - resolution: {integrity: sha512-Ce0GFnzAOuPyfV5SxjXGn0CubwGcuDB0zcdaPuCSzAa/2vII24JTkH+I6jcbXLb1ctjZMZZI6OjDaLPJQL1S0g==} + '@tailwindcss/postcss@4.3.0': + resolution: {integrity: sha512-Jm05Tjx+9yCLGv5qw1c+84Psds8MnyrEQYCB+FFk2lgGiUjlRqdxke4mVTuYrj2xnVZqKim2Apr5ySuQRYAw/w==} '@tailwindcss/typography@0.5.19': resolution: {integrity: sha512-w31dd8HOx3k9vPtcQh5QHP9GwKcgbMp87j58qi6xgiBnFFtKEAgCWnDw4qUT8aHwkCp8bKvb/KGKWWHedP0AAg==} peerDependencies: tailwindcss: '>=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1' - '@types/babel__core@7.20.5': - resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} - - '@types/babel__generator@7.27.0': - resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} - - '@types/babel__template@7.4.4': - resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - - '@types/babel__traverse@7.20.7': - resolution: {integrity: sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==} + '@tybys/wasm-util@0.10.2': + resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/esrecurse@4.3.1': + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} + '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -1721,8 +1812,8 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} - '@types/node@25.0.2': - resolution: {integrity: sha512-gWEkeiyYE4vqjON/+Obqcoeffmk0NF15WSBwSs7zwVA2bAbTaE0SJ7P0WNGoJn8uE7fiaV5a7dKYIJriEqOrmA==} + '@types/node@25.8.0': + resolution: {integrity: sha512-TCFSk8IZh+iLX1xtksoBVtdmgL+1IX0fC9BeU4QqFSuNdN/K+HUlhqOzEmSYYpZUVsLYcPqc9KX+60iDuninSQ==} '@types/picomatch@4.0.2': resolution: {integrity: sha512-qHHxQ+P9PysNEGbALT8f8YOSHW0KJu6l2xU8DYY0fu/EmGxXdVnuTLvFUvBgPJMSqXq29SYHveejeAha+4AYgA==} @@ -1732,8 +1823,8 @@ packages: peerDependencies: '@types/react': ^19.2.0 - '@types/react@19.2.7': - resolution: {integrity: sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==} + '@types/react@19.2.14': + resolution: {integrity: sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==} '@types/supports-color@8.1.3': resolution: {integrity: sha512-Hy6UMpxhE3j1tLpl27exp1XqHD7n8chAiNPzWfz16LPZoMMoSc4dzLl6w9qijkEb/r5O1ozdu1CWGA2L83ZeZg==} @@ -1750,73 +1841,81 @@ packages: '@types/web-bluetooth@0.0.20': resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} - '@typescript-eslint/eslint-plugin@8.49.0': - resolution: {integrity: sha512-JXij0vzIaTtCwu6SxTh8qBc66kmf1xs7pI4UOiMDFVct6q86G0Zs7KRcEoJgY3Cav3x5Tq0MF5jwgpgLqgKG3A==} + '@typescript-eslint/eslint-plugin@8.59.3': + resolution: {integrity: sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.49.0 - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/parser': ^8.59.3 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/parser@8.49.0': - resolution: {integrity: sha512-N9lBGA9o9aqb1hVMc9hzySbhKibHmB+N3IpoShyV6HyQYRGIhlrO5rQgttypi+yEeKsKI4idxC8Jw6gXKD4THA==} + '@typescript-eslint/parser@8.59.3': + resolution: {integrity: sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/project-service@8.49.0': - resolution: {integrity: sha512-/wJN0/DKkmRUMXjZUXYZpD1NEQzQAAn9QWfGwo+Ai8gnzqH7tvqS7oNVdTjKqOcPyVIdZdyCMoqN66Ia789e7g==} + '@typescript-eslint/project-service@8.59.3': + resolution: {integrity: sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <6.0.0' + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/scope-manager@8.49.0': - resolution: {integrity: sha512-npgS3zi+/30KSOkXNs0LQXtsg9ekZ8OISAOLGWA/ZOEn0ZH74Ginfl7foziV8DT+D98WfQ5Kopwqb/PZOaIJGg==} + '@typescript-eslint/scope-manager@8.59.3': + resolution: {integrity: sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/tsconfig-utils@8.49.0': - resolution: {integrity: sha512-8prixNi1/6nawsRYxet4YOhnbW+W9FK/bQPxsGB1D3ZrDzbJ5FXw5XmzxZv82X3B+ZccuSxo/X8q9nQ+mFecWA==} + '@typescript-eslint/tsconfig-utils@8.59.3': + resolution: {integrity: sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <6.0.0' + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/type-utils@8.49.0': - resolution: {integrity: sha512-KTExJfQ+svY8I10P4HdxKzWsvtVnsuCifU5MvXrRwoP2KOlNZ9ADNEWWsQTJgMxLzS5VLQKDjkCT/YzgsnqmZg==} + '@typescript-eslint/type-utils@8.59.3': + resolution: {integrity: sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/types@8.49.0': - resolution: {integrity: sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==} + '@typescript-eslint/types@8.59.3': + resolution: {integrity: sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.49.0': - resolution: {integrity: sha512-jrLdRuAbPfPIdYNppHJ/D0wN+wwNfJ32YTAm10eJVsFmrVpXQnDWBn8niCSMlWjvml8jsce5E/O+86IQtTbJWA==} + '@typescript-eslint/typescript-estree@8.59.3': + resolution: {integrity: sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <6.0.0' + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/utils@8.49.0': - resolution: {integrity: sha512-N3W7rJw7Rw+z1tRsHZbK395TWSYvufBXumYtEGzypgMUthlg0/hmCImeA8hgO2d2G4pd7ftpxxul2J8OdtdaFA==} + '@typescript-eslint/utils@8.59.3': + resolution: {integrity: sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/visitor-keys@8.49.0': - resolution: {integrity: sha512-LlKaciDe3GmZFphXIc79THF/YYBugZ7FS1pO581E/edlVVNbZKDy93evqmrfQ9/Y4uN0vVhX4iuchq26mK/iiA==} + '@typescript-eslint/visitor-keys@8.59.3': + resolution: {integrity: sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + deprecated: Potential CWE-502 - Update to 1.3.1 or higher - '@vitejs/plugin-react@5.1.2': - resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==} + '@vitejs/plugin-react@6.0.2': + resolution: {integrity: sha512-DlSMqo4WhThw4vB8Mpn0Woe9J+Jfq1geJ61AKW0QEgLzGMNwtIMdxbDUzLxcun8W7NbJO0e2Jg/Nxm3cCSVzzg==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: - vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + '@rolldown/plugin-babel': ^0.1.7 || ^0.2.0 + babel-plugin-react-compiler: ^1.0.0 + vite: ^8.0.0 + peerDependenciesMeta: + '@rolldown/plugin-babel': + optional: true + babel-plugin-react-compiler: + optional: true '@vitejs/plugin-vue@5.2.1': resolution: {integrity: sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==} @@ -1923,8 +2022,13 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv@6.15.0: + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} algoliasearch@5.20.0: resolution: {integrity: sha512-groO71Fvi5SWpxjI9Ia+chy0QBwT61mg6yxJV27f5YFf+Mw+STT75K6SHySpP8Co5LsCrtsbCH5dJZSRtkSKaQ==} @@ -1938,10 +2042,6 @@ packages: resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - ansi-styles@6.2.3: resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} @@ -1949,9 +2049,6 @@ packages: any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - astring@1.9.0: resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==} hasBin: true @@ -1959,17 +2056,21 @@ packages: bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + + baseline-browser-mapping@2.10.29: + resolution: {integrity: sha512-Asa2krT+XTPZINCS+2QcyS8WTkObE77RwkydwF7h6DmnKqbvlalz93m/dnphUyCa6SWSP51VgtEUf2FN+gelFQ==} + engines: {node: '>=6.0.0'} + hasBin: true birpc@0.2.19: resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==} - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + brace-expansion@5.0.6: + resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} + engines: {node: 18 || 20 || >=22} braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} @@ -1993,20 +2094,12 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - caniuse-lite@1.0.30001718: resolution: {integrity: sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - character-entities-html4@2.1.0: resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} @@ -2041,13 +2134,6 @@ packages: collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} @@ -2065,9 +2151,6 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - confbox@0.1.8: resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} @@ -2091,9 +2174,6 @@ packages: engines: {node: '>=4'} hasBin: true - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} @@ -2135,8 +2215,8 @@ packages: emoji-regex@10.6.0: resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} - enhanced-resolve@5.18.3: - resolution: {integrity: sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==} + enhanced-resolve@5.21.3: + resolution: {integrity: sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q==} engines: {node: '>=10.13.0'} entities@4.5.0: @@ -2162,13 +2242,13 @@ packages: engines: {node: '>=12'} hasBin: true - esbuild@0.25.12: - resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==} + esbuild@0.27.1: + resolution: {integrity: sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==} engines: {node: '>=18'} hasBin: true - esbuild@0.27.1: - resolution: {integrity: sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==} + esbuild@0.28.0: + resolution: {integrity: sha512-sNR9MHpXSUV/XB4zmsFKN+QgVG82Cc7+/aaxJ8Adi8hyOac+EXptIp45QBPaVyX3N70664wRbTcLTOemCAnyqw==} engines: {node: '>=18'} hasBin: true @@ -2184,32 +2264,32 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} - eslint-plugin-react-hooks@7.0.1: - resolution: {integrity: sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==} + eslint-plugin-react-hooks@7.1.1: + resolution: {integrity: sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==} engines: {node: '>=18'} peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0 - eslint-plugin-react-refresh@0.4.25: - resolution: {integrity: sha512-dRUD2LOdEqI4zXHqbQ442blQAzdSuShAaiSq5Vtyy6LT08YUf0oOjBDo4VPx0dCPgiPWh1WB4dtbLOd0kOlDPQ==} + eslint-plugin-react-refresh@0.5.2: + resolution: {integrity: sha512-hmgTH57GfzoTFjVN0yBwTggnsVUF2tcqi7RJZHqi9lIezSs4eFyAMktA68YD4r5kNw1mxyY4dmkyoFDb3FIqrA==} peerDependencies: - eslint: '>=8.40' + eslint: ^9 || ^10 - eslint-scope@8.4.0: - resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-scope@9.1.2: + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.2.1: - resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-visitor-keys@5.0.1: + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - eslint@9.39.2: - resolution: {integrity: sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint@10.4.0: + resolution: {integrity: sha512-loXy6bWOoP3EP6JA7jo6p5jMpBJmHmsNZM5SFRHLdh1MGOPurMnNBj4ZlAbaqUAaQWbCr7jHV4P7gzAyryZWkQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} hasBin: true peerDependencies: jiti: '*' @@ -2217,12 +2297,12 @@ packages: jiti: optional: true - espree@10.4.0: - resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + espree@11.2.0: + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - esquery@1.6.0: - resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} engines: {node: '>=0.10'} esrecurse@4.3.0: @@ -2330,9 +2410,6 @@ packages: resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} engines: {node: '>=18'} - get-tsconfig@4.13.0: - resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==} - github-slugger@2.0.0: resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==} @@ -2344,21 +2421,13 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} - - globals@16.5.0: - resolution: {integrity: sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==} + globals@17.6.0: + resolution: {integrity: sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==} engines: {node: '>=18'} graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - hast-util-from-html@2.0.3: resolution: {integrity: sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==} @@ -2408,14 +2477,10 @@ packages: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} - ignore@7.0.4: - resolution: {integrity: sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==} + ignore@7.0.5: + resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} engines: {node: '>= 4'} - import-fresh@3.3.1: - resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} - engines: {node: '>=6'} - imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -2473,10 +2538,6 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - jsesc@3.1.0: resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} @@ -2503,74 +2564,78 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - lightningcss-android-arm64@1.30.2: - resolution: {integrity: sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A==} + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [android] - lightningcss-darwin-arm64@1.30.2: - resolution: {integrity: sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA==} + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [darwin] - lightningcss-darwin-x64@1.30.2: - resolution: {integrity: sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ==} + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [darwin] - lightningcss-freebsd-x64@1.30.2: - resolution: {integrity: sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA==} + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [freebsd] - lightningcss-linux-arm-gnueabihf@1.30.2: - resolution: {integrity: sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA==} + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} engines: {node: '>= 12.0.0'} cpu: [arm] os: [linux] - lightningcss-linux-arm64-gnu@1.30.2: - resolution: {integrity: sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A==} + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] - lightningcss-linux-arm64-musl@1.30.2: - resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==} + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] - lightningcss-linux-x64-gnu@1.30.2: - resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==} + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] - lightningcss-linux-x64-musl@1.30.2: - resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==} + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] - lightningcss-win32-arm64-msvc@1.30.2: - resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==} + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [win32] - lightningcss-win32-x64-msvc@1.30.2: - resolution: {integrity: sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw==} + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [win32] - lightningcss@1.30.2: - resolution: {integrity: sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==} + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} engines: {node: '>= 12.0.0'} lilconfig@3.1.3: @@ -2597,9 +2662,6 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} - lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - log-update@6.1.0: resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} engines: {node: '>=18'} @@ -2794,12 +2856,9 @@ packages: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minimatch@9.0.5: - resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} - engines: {node: '>=16 || 14 >=14.17'} + minimatch@10.2.5: + resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} + engines: {node: 18 || 20 || >=22} minisearch@7.1.1: resolution: {integrity: sha512-b3YZEYCEH4EdCAtYP7OlDyx7FdPwNzuNwLQ34SfJpM9dlbBZzeXndGavTrC+VCiRWomL21SWfMc6SCKO/U2ZNw==} @@ -2855,6 +2914,27 @@ packages: sass: optional: true + next@16.2.6: + resolution: {integrity: sha512-qOVgKJg1+At15NpeUP+eJgCHvTCgXsogweq87Ri/Ix7PkqQHg4sdaXmSFqKlgaIXE4kW0g25LE68W87UANlHtw==} + engines: {node: '>=20.9.0'} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + '@playwright/test': ^1.51.1 + babel-plugin-react-compiler: '*' + react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 + react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + '@playwright/test': + optional: true + babel-plugin-react-compiler: + optional: true + sass: + optional: true + node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} @@ -2890,10 +2970,6 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - parse-entities@4.0.2: resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} @@ -2928,6 +3004,10 @@ packages: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + engines: {node: '>=12'} + pidtree@0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} engines: {node: '>=0.10'} @@ -2966,6 +3046,10 @@ packages: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} + postcss@8.5.14: + resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==} + engines: {node: ^10 || ^12 || >=14} + postcss@8.5.6: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} @@ -2977,8 +3061,8 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.7.4: - resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==} + prettier@3.8.3: + resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} engines: {node: '>=14'} hasBin: true @@ -2992,17 +3076,13 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - react-dom@19.2.3: - resolution: {integrity: sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==} + react-dom@19.2.6: + resolution: {integrity: sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==} peerDependencies: - react: ^19.2.3 - - react-refresh@0.18.0: - resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==} - engines: {node: '>=0.10.0'} + react: ^19.2.6 - react@19.2.3: - resolution: {integrity: sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==} + react@19.2.6: + resolution: {integrity: sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==} engines: {node: '>=0.10.0'} readdirp@4.1.2: @@ -3045,11 +3125,11 @@ packages: rehype-parse@9.0.1: resolution: {integrity: sha512-ksCzCD0Fgfh7trPDxr2rSylbwq9iYDkSn8TCDmEJ49ljEUBxDVCzCHv7QNzZOfODanX4+bWQ4WZqLCRWYLfhag==} - rehype-pretty-code@0.14.1: - resolution: {integrity: sha512-IpG4OL0iYlbx78muVldsK86hdfNoht0z63AP7sekQNW2QOTmjxB7RbTO+rhIYNGRljgHxgVZoPwUl6bIC9SbjA==} + rehype-pretty-code@0.14.3: + resolution: {integrity: sha512-Cz692FeYusTjT5cfFWLc4r7JhgC3/JlJptgUh4iffBxWxUnWW1oqbWFi7jGCeq00DYUm8yzoTnvpocaYa5x82g==} engines: {node: '>=18'} peerDependencies: - shiki: ^1.0.0 || ^2.0.0 || ^3.0.0 + shiki: ^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 rehype-raw@7.0.0: resolution: {integrity: sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==} @@ -3075,17 +3155,10 @@ packages: remark-stringify@11.0.0: resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} - resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} - resolve-pkg-maps@1.0.0: - resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - restore-cursor@5.1.0: resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} engines: {node: '>=18'} @@ -3097,13 +3170,13 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rollup@4.41.0: - resolution: {integrity: sha512-HqMFpUbWlf/tvcxBFNKnJyzc7Lk+XO3FGc3pbNBLqEbOz0gPLRgcrlS3UF4MfUrVlstOaP/q0kM6GVvi+LrLRg==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} + rolldown@1.0.1: + resolution: {integrity: sha512-X0KQHljNnEkWNqqiz9zJrGunh1B0HgOxLXvnFpCOcadzcy5qohZ3tqMEUg00vncoRovXuK3ZqCT9KnnKzoInFQ==} + engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - rollup@4.48.1: - resolution: {integrity: sha512-jVG20NvbhTYDkGAty2/Yh7HK6/q3DGSRH4o8ALKGArmMuaauM9kLfoMZ+WliPwA5+JHr2lTn3g557FxBV87ifg==} + rollup@4.41.0: + resolution: {integrity: sha512-HqMFpUbWlf/tvcxBFNKnJyzc7Lk+XO3FGc3pbNBLqEbOz0gPLRgcrlS3UF4MfUrVlstOaP/q0kM6GVvi+LrLRg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3145,8 +3218,9 @@ packages: shiki@2.5.0: resolution: {integrity: sha512-mI//trrsaiCIPsja5CNfsyNOqgAZUb6VpJA+340toL42UpzQlXpwRV9nch69X6gaUxrr9kaOOa6e3y3uAkGFxQ==} - shiki@3.20.0: - resolution: {integrity: sha512-kgCOlsnyWb+p0WU+01RjkCH+eBVsjL1jOwUYWv0YDWkM2/A46+LDKVs5yZCUXjJG6bj4ndFoAg5iLIIue6dulg==} + shiki@4.0.2: + resolution: {integrity: sha512-eAVKTMedR5ckPo4xne/PjYQYrU3qx78gtJZ+sHlXEg5IHhhoQhMfZVzetTYuaJS0L2Ef3AcCRzCHV8T0WI6nIQ==} + engines: {node: '>=20'} signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -3205,10 +3279,6 @@ packages: resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} engines: {node: '>=12'} - strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - style-to-js@1.1.21: resolution: {integrity: sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==} @@ -3237,10 +3307,6 @@ packages: resolution: {integrity: sha512-5JRxVqC8I8NuOUjzBbvVJAKNM8qoVuH0O77h4WInc/qC2q5IreqKxYwgkga3PfA22OayK2ikceb/B26dztPl+Q==} engines: {node: '>=16'} - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - supports-color@9.4.0: resolution: {integrity: sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==} engines: {node: '>=12'} @@ -3248,11 +3314,11 @@ packages: tabbable@6.2.0: resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} - tailwindcss@4.1.18: - resolution: {integrity: sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==} + tailwindcss@4.3.0: + resolution: {integrity: sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==} - tapable@2.2.2: - resolution: {integrity: sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==} + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} terser@5.44.1: @@ -3270,14 +3336,14 @@ packages: tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyglobby@0.2.14: - resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} - engines: {node: '>=12.0.0'} - tinyglobby@0.2.15: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} + tinyglobby@0.2.16: + resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} + engines: {node: '>=12.0.0'} + to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -3292,8 +3358,8 @@ packages: trough@2.2.0: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} - ts-api-utils@2.1.0: - resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} + ts-api-utils@2.5.0: + resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} engines: {node: '>=18.12'} peerDependencies: typescript: '>=4.8.4' @@ -3323,8 +3389,8 @@ packages: typescript: optional: true - tsx@4.21.0: - resolution: {integrity: sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==} + tsx@4.22.0: + resolution: {integrity: sha512-8ccZMPD69s1AbKXx0C5ddTNZfNjwV04iIKgjZmKfKxMynEtSYcK0Lh7iQFh53fI5Yu4pb9usgAiqyPmEONaALg==} engines: {node: '>=18.0.0'} hasBin: true @@ -3332,23 +3398,23 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - typescript-eslint@8.49.0: - resolution: {integrity: sha512-zRSVH1WXD0uXczCXw+nsdjGPUdx4dfrs5VQoHnUWmv1U3oNlAKv4FUNdLDhVUg+gYn+a5hUESqch//Rv5wVhrg==} + typescript-eslint@8.59.3: + resolution: {integrity: sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} engines: {node: '>=14.17'} hasBin: true ufo@1.6.1: resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} - undici-types@7.16.0: - resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + undici-types@7.24.6: + resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} unified@11.0.5: resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} @@ -3432,15 +3498,16 @@ packages: terser: optional: true - vite@7.1.3: - resolution: {integrity: sha512-OOUi5zjkDxYrKhTV3V7iKsoS37VUM7v40+HuwEmcrsf11Cdx9y3DIr2Px6liIcZFwt3XSRpQvFpL3WVy7ApkGw==} + vite@8.0.13: + resolution: {integrity: sha512-MFtjBYgzmSxmgA4RAfjIyXWpGe1oALnjgUTzzV7QLx/TKxCzjtMH6Fd9/eVK+5Fg1qNoz5VAwsmMs/NofrmJvw==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.1.18 + esbuild: ^0.27.0 || ^0.28.0 jiti: '>=1.21.0' less: ^4.0.0 - lightningcss: ^1.21.0 sass: ^1.70.0 sass-embedded: ^1.70.0 stylus: '>=0.54.8' @@ -3451,52 +3518,14 @@ packages: peerDependenciesMeta: '@types/node': optional: true - jiti: - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: + '@vitejs/devtools': optional: true - - vite@7.2.7: - resolution: {integrity: sha512-ITcnkFeR3+fI8P1wMgItjGrR10170d8auB4EpMLPqmx6uxElH3a/hHGQabSHKdqd4FXWO1nFIp9rRn7JQ34ACQ==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - peerDependencies: - '@types/node': ^20.19.0 || >=22.12.0 - jiti: '>=1.21.0' - less: ^4.0.0 - lightningcss: ^1.21.0 - sass: ^1.70.0 - sass-embedded: ^1.70.0 - stylus: '>=0.54.8' - sugarss: ^5.0.0 - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - '@types/node': + esbuild: optional: true jiti: optional: true less: optional: true - lightningcss: - optional: true sass: optional: true sass-embedded: @@ -3556,6 +3585,11 @@ packages: engines: {node: '>= 14.6'} hasBin: true + yaml@2.9.0: + resolution: {integrity: sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==} + engines: {node: '>= 14.6'} + hasBin: true + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -3569,6 +3603,9 @@ packages: zod@4.1.13: resolution: {integrity: sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==} + zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -3681,11 +3718,6 @@ snapshots: '@alloc/quick-lru@5.2.0': {} - '@ampproject/remapping@2.3.0': - dependencies: - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - '@babel/code-frame@7.27.1': dependencies: '@babel/helper-validator-identifier': 7.28.5 @@ -3694,26 +3726,6 @@ snapshots: '@babel/compat-data@7.27.2': {} - '@babel/core@7.28.3': - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.5 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.3) - '@babel/helpers': 7.28.3 - '@babel/parser': 7.28.5 - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 - convert-source-map: 2.0.0 - debug: 4.4.3 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - '@babel/core@7.28.5': dependencies: '@babel/code-frame': 7.27.1 @@ -3759,15 +3771,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.3)': - dependencies: - '@babel/core': 7.28.3 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color - '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 @@ -3777,19 +3780,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-plugin-utils@7.27.1': {} - '@babel/helper-string-parser@7.27.1': {} '@babel/helper-validator-identifier@7.28.5': {} '@babel/helper-validator-option@7.27.1': {} - '@babel/helpers@7.28.3': - dependencies: - '@babel/template': 7.27.2 - '@babel/types': 7.28.5 - '@babel/helpers@7.28.4': dependencies: '@babel/template': 7.27.2 @@ -3799,16 +3795,6 @@ snapshots: dependencies: '@babel/types': 7.28.5 - '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.27.1 @@ -3856,285 +3842,289 @@ snapshots: transitivePeerDependencies: - '@algolia/client-search' + '@emnapi/core@1.10.0': + dependencies: + '@emnapi/wasi-threads': 1.2.1 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.10.0': + dependencies: + tslib: 2.8.1 + optional: true + '@emnapi/runtime@1.7.1': dependencies: tslib: 2.8.1 optional: true - '@esbuild/aix-ppc64@0.21.5': + '@emnapi/wasi-threads@1.2.1': + dependencies: + tslib: 2.8.1 optional: true - '@esbuild/aix-ppc64@0.25.12': + '@esbuild/aix-ppc64@0.21.5': optional: true '@esbuild/aix-ppc64@0.27.1': optional: true - '@esbuild/android-arm64@0.21.5': + '@esbuild/aix-ppc64@0.28.0': optional: true - '@esbuild/android-arm64@0.25.12': + '@esbuild/android-arm64@0.21.5': optional: true '@esbuild/android-arm64@0.27.1': optional: true - '@esbuild/android-arm@0.21.5': + '@esbuild/android-arm64@0.28.0': optional: true - '@esbuild/android-arm@0.25.12': + '@esbuild/android-arm@0.21.5': optional: true '@esbuild/android-arm@0.27.1': optional: true - '@esbuild/android-x64@0.21.5': + '@esbuild/android-arm@0.28.0': optional: true - '@esbuild/android-x64@0.25.12': + '@esbuild/android-x64@0.21.5': optional: true '@esbuild/android-x64@0.27.1': optional: true - '@esbuild/darwin-arm64@0.21.5': + '@esbuild/android-x64@0.28.0': optional: true - '@esbuild/darwin-arm64@0.25.12': + '@esbuild/darwin-arm64@0.21.5': optional: true '@esbuild/darwin-arm64@0.27.1': optional: true - '@esbuild/darwin-x64@0.21.5': + '@esbuild/darwin-arm64@0.28.0': optional: true - '@esbuild/darwin-x64@0.25.12': + '@esbuild/darwin-x64@0.21.5': optional: true '@esbuild/darwin-x64@0.27.1': optional: true - '@esbuild/freebsd-arm64@0.21.5': + '@esbuild/darwin-x64@0.28.0': optional: true - '@esbuild/freebsd-arm64@0.25.12': + '@esbuild/freebsd-arm64@0.21.5': optional: true '@esbuild/freebsd-arm64@0.27.1': optional: true - '@esbuild/freebsd-x64@0.21.5': + '@esbuild/freebsd-arm64@0.28.0': optional: true - '@esbuild/freebsd-x64@0.25.12': + '@esbuild/freebsd-x64@0.21.5': optional: true '@esbuild/freebsd-x64@0.27.1': optional: true - '@esbuild/linux-arm64@0.21.5': + '@esbuild/freebsd-x64@0.28.0': optional: true - '@esbuild/linux-arm64@0.25.12': + '@esbuild/linux-arm64@0.21.5': optional: true '@esbuild/linux-arm64@0.27.1': optional: true - '@esbuild/linux-arm@0.21.5': + '@esbuild/linux-arm64@0.28.0': optional: true - '@esbuild/linux-arm@0.25.12': + '@esbuild/linux-arm@0.21.5': optional: true '@esbuild/linux-arm@0.27.1': optional: true - '@esbuild/linux-ia32@0.21.5': + '@esbuild/linux-arm@0.28.0': optional: true - '@esbuild/linux-ia32@0.25.12': + '@esbuild/linux-ia32@0.21.5': optional: true '@esbuild/linux-ia32@0.27.1': optional: true - '@esbuild/linux-loong64@0.21.5': + '@esbuild/linux-ia32@0.28.0': optional: true - '@esbuild/linux-loong64@0.25.12': + '@esbuild/linux-loong64@0.21.5': optional: true '@esbuild/linux-loong64@0.27.1': optional: true - '@esbuild/linux-mips64el@0.21.5': + '@esbuild/linux-loong64@0.28.0': optional: true - '@esbuild/linux-mips64el@0.25.12': + '@esbuild/linux-mips64el@0.21.5': optional: true '@esbuild/linux-mips64el@0.27.1': optional: true - '@esbuild/linux-ppc64@0.21.5': + '@esbuild/linux-mips64el@0.28.0': optional: true - '@esbuild/linux-ppc64@0.25.12': + '@esbuild/linux-ppc64@0.21.5': optional: true '@esbuild/linux-ppc64@0.27.1': optional: true - '@esbuild/linux-riscv64@0.21.5': + '@esbuild/linux-ppc64@0.28.0': optional: true - '@esbuild/linux-riscv64@0.25.12': + '@esbuild/linux-riscv64@0.21.5': optional: true '@esbuild/linux-riscv64@0.27.1': optional: true - '@esbuild/linux-s390x@0.21.5': + '@esbuild/linux-riscv64@0.28.0': optional: true - '@esbuild/linux-s390x@0.25.12': + '@esbuild/linux-s390x@0.21.5': optional: true '@esbuild/linux-s390x@0.27.1': optional: true - '@esbuild/linux-x64@0.21.5': + '@esbuild/linux-s390x@0.28.0': optional: true - '@esbuild/linux-x64@0.25.12': + '@esbuild/linux-x64@0.21.5': optional: true '@esbuild/linux-x64@0.27.1': optional: true - '@esbuild/netbsd-arm64@0.25.12': + '@esbuild/linux-x64@0.28.0': optional: true '@esbuild/netbsd-arm64@0.27.1': optional: true - '@esbuild/netbsd-x64@0.21.5': + '@esbuild/netbsd-arm64@0.28.0': optional: true - '@esbuild/netbsd-x64@0.25.12': + '@esbuild/netbsd-x64@0.21.5': optional: true '@esbuild/netbsd-x64@0.27.1': optional: true - '@esbuild/openbsd-arm64@0.25.12': + '@esbuild/netbsd-x64@0.28.0': optional: true '@esbuild/openbsd-arm64@0.27.1': optional: true - '@esbuild/openbsd-x64@0.21.5': + '@esbuild/openbsd-arm64@0.28.0': optional: true - '@esbuild/openbsd-x64@0.25.12': + '@esbuild/openbsd-x64@0.21.5': optional: true '@esbuild/openbsd-x64@0.27.1': optional: true - '@esbuild/openharmony-arm64@0.25.12': + '@esbuild/openbsd-x64@0.28.0': optional: true '@esbuild/openharmony-arm64@0.27.1': optional: true - '@esbuild/sunos-x64@0.21.5': + '@esbuild/openharmony-arm64@0.28.0': optional: true - '@esbuild/sunos-x64@0.25.12': + '@esbuild/sunos-x64@0.21.5': optional: true '@esbuild/sunos-x64@0.27.1': optional: true - '@esbuild/win32-arm64@0.21.5': + '@esbuild/sunos-x64@0.28.0': optional: true - '@esbuild/win32-arm64@0.25.12': + '@esbuild/win32-arm64@0.21.5': optional: true '@esbuild/win32-arm64@0.27.1': optional: true - '@esbuild/win32-ia32@0.21.5': + '@esbuild/win32-arm64@0.28.0': optional: true - '@esbuild/win32-ia32@0.25.12': + '@esbuild/win32-ia32@0.21.5': optional: true '@esbuild/win32-ia32@0.27.1': optional: true - '@esbuild/win32-x64@0.21.5': + '@esbuild/win32-ia32@0.28.0': optional: true - '@esbuild/win32-x64@0.25.12': + '@esbuild/win32-x64@0.21.5': optional: true '@esbuild/win32-x64@0.27.1': optional: true - '@eslint-community/eslint-utils@4.7.0(eslint@9.39.2(jiti@2.6.1))': + '@esbuild/win32-x64@0.28.0': + optional: true + + '@eslint-community/eslint-utils@4.9.0(eslint@10.4.0(jiti@2.6.1))': dependencies: - eslint: 9.39.2(jiti@2.6.1) + eslint: 10.4.0(jiti@2.6.1) eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.9.0(eslint@9.39.2(jiti@2.6.1))': + '@eslint-community/eslint-utils@4.9.1(eslint@10.4.0(jiti@2.6.1))': dependencies: - eslint: 9.39.2(jiti@2.6.1) + eslint: 10.4.0(jiti@2.6.1) eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.12.1': {} + '@eslint-community/regexpp@4.12.2': {} - '@eslint/config-array@0.21.1': + '@eslint/config-array@0.23.5': dependencies: - '@eslint/object-schema': 2.1.7 + '@eslint/object-schema': 3.0.5 debug: 4.4.3 - minimatch: 3.1.2 + minimatch: 10.2.5 transitivePeerDependencies: - supports-color - '@eslint/config-helpers@0.4.2': + '@eslint/config-helpers@0.6.0': dependencies: - '@eslint/core': 0.17.0 + '@eslint/core': 1.2.1 - '@eslint/core@0.17.0': + '@eslint/core@1.2.1': dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.1': - dependencies: - ajv: 6.12.6 - debug: 4.4.3 - espree: 10.4.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.1 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - - '@eslint/js@9.39.2': {} + '@eslint/js@10.0.1(eslint@10.4.0(jiti@2.6.1))': + optionalDependencies: + eslint: 10.4.0(jiti@2.6.1) - '@eslint/object-schema@2.1.7': {} + '@eslint/object-schema@3.0.5': {} - '@eslint/plugin-kit@0.4.1': + '@eslint/plugin-kit@0.7.1': dependencies: - '@eslint/core': 0.17.0 + '@eslint/core': 1.2.1 levn: 0.4.1 '@humanfs/core@0.19.1': {} @@ -4150,13 +4140,13 @@ snapshots: '@humanwhocodes/retry@0.4.3': {} - '@ianvs/prettier-plugin-sort-imports@4.7.0(@vue/compiler-sfc@3.5.13)(prettier@3.7.4)': + '@ianvs/prettier-plugin-sort-imports@4.7.0(@vue/compiler-sfc@3.5.13)(prettier@3.8.3)': dependencies: '@babel/generator': 7.28.5 '@babel/parser': 7.28.5 '@babel/traverse': 7.28.5 '@babel/types': 7.28.5 - prettier: 3.7.4 + prettier: 3.8.3 semver: 7.7.3 optionalDependencies: '@vue/compiler-sfc': 3.5.13 @@ -4321,32 +4311,65 @@ snapshots: transitivePeerDependencies: - supports-color + '@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + dependencies: + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@tybys/wasm-util': 0.10.2 + optional: true + '@next/env@16.0.10': {} + '@next/env@16.2.6': {} + '@next/swc-darwin-arm64@16.0.10': optional: true + '@next/swc-darwin-arm64@16.2.6': + optional: true + '@next/swc-darwin-x64@16.0.10': optional: true + '@next/swc-darwin-x64@16.2.6': + optional: true + '@next/swc-linux-arm64-gnu@16.0.10': optional: true + '@next/swc-linux-arm64-gnu@16.2.6': + optional: true + '@next/swc-linux-arm64-musl@16.0.10': optional: true + '@next/swc-linux-arm64-musl@16.2.6': + optional: true + '@next/swc-linux-x64-gnu@16.0.10': optional: true + '@next/swc-linux-x64-gnu@16.2.6': + optional: true + '@next/swc-linux-x64-musl@16.0.10': optional: true + '@next/swc-linux-x64-musl@16.2.6': + optional: true + '@next/swc-win32-arm64-msvc@16.0.10': optional: true + '@next/swc-win32-arm64-msvc@16.2.6': + optional: true + '@next/swc-win32-x64-msvc@16.0.10': optional: true + '@next/swc-win32-x64-msvc@16.2.6': + optional: true + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -4359,129 +4382,138 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 - '@rolldown/pluginutils@1.0.0-beta.53': {} + '@oxc-project/types@0.130.0': {} - '@rollup/rollup-android-arm-eabi@4.41.0': + '@rolldown/binding-android-arm64@1.0.1': optional: true - '@rollup/rollup-android-arm-eabi@4.48.1': + '@rolldown/binding-darwin-arm64@1.0.1': optional: true - '@rollup/rollup-android-arm-eabi@4.53.3': + '@rolldown/binding-darwin-x64@1.0.1': optional: true - '@rollup/rollup-android-arm64@4.41.0': + '@rolldown/binding-freebsd-x64@1.0.1': optional: true - '@rollup/rollup-android-arm64@4.48.1': + '@rolldown/binding-linux-arm-gnueabihf@1.0.1': optional: true - '@rollup/rollup-android-arm64@4.53.3': + '@rolldown/binding-linux-arm64-gnu@1.0.1': optional: true - '@rollup/rollup-darwin-arm64@4.41.0': + '@rolldown/binding-linux-arm64-musl@1.0.1': optional: true - '@rollup/rollup-darwin-arm64@4.48.1': + '@rolldown/binding-linux-ppc64-gnu@1.0.1': optional: true - '@rollup/rollup-darwin-arm64@4.53.3': + '@rolldown/binding-linux-s390x-gnu@1.0.1': optional: true - '@rollup/rollup-darwin-x64@4.41.0': + '@rolldown/binding-linux-x64-gnu@1.0.1': optional: true - '@rollup/rollup-darwin-x64@4.48.1': + '@rolldown/binding-linux-x64-musl@1.0.1': optional: true - '@rollup/rollup-darwin-x64@4.53.3': + '@rolldown/binding-openharmony-arm64@1.0.1': optional: true - '@rollup/rollup-freebsd-arm64@4.41.0': + '@rolldown/binding-wasm32-wasi@1.0.1': + dependencies: + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) optional: true - '@rollup/rollup-freebsd-arm64@4.48.1': + '@rolldown/binding-win32-arm64-msvc@1.0.1': optional: true - '@rollup/rollup-freebsd-arm64@4.53.3': + '@rolldown/binding-win32-x64-msvc@1.0.1': optional: true - '@rollup/rollup-freebsd-x64@4.41.0': + '@rolldown/pluginutils@1.0.1': {} + + '@rollup/rollup-android-arm-eabi@4.41.0': optional: true - '@rollup/rollup-freebsd-x64@4.48.1': + '@rollup/rollup-android-arm-eabi@4.53.3': optional: true - '@rollup/rollup-freebsd-x64@4.53.3': + '@rollup/rollup-android-arm64@4.41.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.41.0': + '@rollup/rollup-android-arm64@4.53.3': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.48.1': + '@rollup/rollup-darwin-arm64@4.41.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.53.3': + '@rollup/rollup-darwin-arm64@4.53.3': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.41.0': + '@rollup/rollup-darwin-x64@4.41.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.48.1': + '@rollup/rollup-darwin-x64@4.53.3': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.53.3': + '@rollup/rollup-freebsd-arm64@4.41.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.41.0': + '@rollup/rollup-freebsd-arm64@4.53.3': optional: true - '@rollup/rollup-linux-arm64-gnu@4.48.1': + '@rollup/rollup-freebsd-x64@4.41.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.53.3': + '@rollup/rollup-freebsd-x64@4.53.3': optional: true - '@rollup/rollup-linux-arm64-musl@4.41.0': + '@rollup/rollup-linux-arm-gnueabihf@4.41.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.48.1': + '@rollup/rollup-linux-arm-gnueabihf@4.53.3': optional: true - '@rollup/rollup-linux-arm64-musl@4.53.3': + '@rollup/rollup-linux-arm-musleabihf@4.41.0': optional: true - '@rollup/rollup-linux-loong64-gnu@4.53.3': + '@rollup/rollup-linux-arm-musleabihf@4.53.3': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.41.0': + '@rollup/rollup-linux-arm64-gnu@4.41.0': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.48.1': + '@rollup/rollup-linux-arm64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.41.0': + '@rollup/rollup-linux-arm64-musl@4.41.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.48.1': + '@rollup/rollup-linux-arm64-musl@4.53.3': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.53.3': + '@rollup/rollup-linux-loong64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.41.0': + '@rollup/rollup-linux-loongarch64-gnu@4.41.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.48.1': + '@rollup/rollup-linux-powerpc64le-gnu@4.41.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.53.3': + '@rollup/rollup-linux-ppc64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-riscv64-musl@4.41.0': + '@rollup/rollup-linux-riscv64-gnu@4.41.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-riscv64-musl@4.48.1': + '@rollup/rollup-linux-riscv64-musl@4.41.0': optional: true '@rollup/rollup-linux-riscv64-musl@4.53.3': @@ -4490,27 +4522,18 @@ snapshots: '@rollup/rollup-linux-s390x-gnu@4.41.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.48.1': - optional: true - '@rollup/rollup-linux-s390x-gnu@4.53.3': optional: true '@rollup/rollup-linux-x64-gnu@4.41.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.48.1': - optional: true - '@rollup/rollup-linux-x64-gnu@4.53.3': optional: true '@rollup/rollup-linux-x64-musl@4.41.0': optional: true - '@rollup/rollup-linux-x64-musl@4.48.1': - optional: true - '@rollup/rollup-linux-x64-musl@4.53.3': optional: true @@ -4520,18 +4543,12 @@ snapshots: '@rollup/rollup-win32-arm64-msvc@4.41.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.48.1': - optional: true - '@rollup/rollup-win32-arm64-msvc@4.53.3': optional: true '@rollup/rollup-win32-ia32-msvc@4.41.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.48.1': - optional: true - '@rollup/rollup-win32-ia32-msvc@4.53.3': optional: true @@ -4541,9 +4558,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.41.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.48.1': - optional: true - '@rollup/rollup-win32-x64-msvc@4.53.3': optional: true @@ -4565,9 +4579,10 @@ snapshots: '@types/hast': 3.0.4 hast-util-to-html: 9.0.5 - '@shikijs/core@3.20.0': + '@shikijs/core@4.0.2': dependencies: - '@shikijs/types': 3.20.0 + '@shikijs/primitive': 4.0.2 + '@shikijs/types': 4.0.2 '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 hast-util-to-html: 9.0.5 @@ -4584,9 +4599,9 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 oniguruma-to-es: 3.1.1 - '@shikijs/engine-javascript@3.20.0': + '@shikijs/engine-javascript@4.0.2': dependencies: - '@shikijs/types': 3.20.0 + '@shikijs/types': 4.0.2 '@shikijs/vscode-textmate': 10.0.2 oniguruma-to-es: 4.3.4 @@ -4600,26 +4615,32 @@ snapshots: '@shikijs/types': 2.5.0 '@shikijs/vscode-textmate': 10.0.2 - '@shikijs/engine-oniguruma@3.20.0': + '@shikijs/engine-oniguruma@4.0.2': dependencies: - '@shikijs/types': 3.20.0 + '@shikijs/types': 4.0.2 '@shikijs/vscode-textmate': 10.0.2 '@shikijs/langs@2.5.0': dependencies: '@shikijs/types': 2.5.0 - '@shikijs/langs@3.20.0': + '@shikijs/langs@4.0.2': + dependencies: + '@shikijs/types': 4.0.2 + + '@shikijs/primitive@4.0.2': dependencies: - '@shikijs/types': 3.20.0 + '@shikijs/types': 4.0.2 + '@shikijs/vscode-textmate': 10.0.2 + '@types/hast': 3.0.4 '@shikijs/themes@2.5.0': dependencies: '@shikijs/types': 2.5.0 - '@shikijs/themes@3.20.0': + '@shikijs/themes@4.0.2': dependencies: - '@shikijs/types': 3.20.0 + '@shikijs/types': 4.0.2 '@shikijs/transformers@2.1.0': dependencies: @@ -4636,7 +4657,7 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 - '@shikijs/types@3.20.0': + '@shikijs/types@4.0.2': dependencies: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 @@ -4647,105 +4668,91 @@ snapshots: dependencies: tslib: 2.8.1 - '@tailwindcss/node@4.1.18': + '@tailwindcss/node@4.3.0': dependencies: '@jridgewell/remapping': 2.3.5 - enhanced-resolve: 5.18.3 + enhanced-resolve: 5.21.3 jiti: 2.6.1 - lightningcss: 1.30.2 + lightningcss: 1.32.0 magic-string: 0.30.21 source-map-js: 1.2.1 - tailwindcss: 4.1.18 + tailwindcss: 4.3.0 - '@tailwindcss/oxide-android-arm64@4.1.18': + '@tailwindcss/oxide-android-arm64@4.3.0': optional: true - '@tailwindcss/oxide-darwin-arm64@4.1.18': + '@tailwindcss/oxide-darwin-arm64@4.3.0': optional: true - '@tailwindcss/oxide-darwin-x64@4.1.18': + '@tailwindcss/oxide-darwin-x64@4.3.0': optional: true - '@tailwindcss/oxide-freebsd-x64@4.1.18': + '@tailwindcss/oxide-freebsd-x64@4.3.0': optional: true - '@tailwindcss/oxide-linux-arm-gnueabihf@4.1.18': + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0': optional: true - '@tailwindcss/oxide-linux-arm64-gnu@4.1.18': + '@tailwindcss/oxide-linux-arm64-gnu@4.3.0': optional: true - '@tailwindcss/oxide-linux-arm64-musl@4.1.18': + '@tailwindcss/oxide-linux-arm64-musl@4.3.0': optional: true - '@tailwindcss/oxide-linux-x64-gnu@4.1.18': + '@tailwindcss/oxide-linux-x64-gnu@4.3.0': optional: true - '@tailwindcss/oxide-linux-x64-musl@4.1.18': + '@tailwindcss/oxide-linux-x64-musl@4.3.0': optional: true - '@tailwindcss/oxide-wasm32-wasi@4.1.18': + '@tailwindcss/oxide-wasm32-wasi@4.3.0': optional: true - '@tailwindcss/oxide-win32-arm64-msvc@4.1.18': + '@tailwindcss/oxide-win32-arm64-msvc@4.3.0': optional: true - '@tailwindcss/oxide-win32-x64-msvc@4.1.18': + '@tailwindcss/oxide-win32-x64-msvc@4.3.0': optional: true - '@tailwindcss/oxide@4.1.18': + '@tailwindcss/oxide@4.3.0': optionalDependencies: - '@tailwindcss/oxide-android-arm64': 4.1.18 - '@tailwindcss/oxide-darwin-arm64': 4.1.18 - '@tailwindcss/oxide-darwin-x64': 4.1.18 - '@tailwindcss/oxide-freebsd-x64': 4.1.18 - '@tailwindcss/oxide-linux-arm-gnueabihf': 4.1.18 - '@tailwindcss/oxide-linux-arm64-gnu': 4.1.18 - '@tailwindcss/oxide-linux-arm64-musl': 4.1.18 - '@tailwindcss/oxide-linux-x64-gnu': 4.1.18 - '@tailwindcss/oxide-linux-x64-musl': 4.1.18 - '@tailwindcss/oxide-wasm32-wasi': 4.1.18 - '@tailwindcss/oxide-win32-arm64-msvc': 4.1.18 - '@tailwindcss/oxide-win32-x64-msvc': 4.1.18 - - '@tailwindcss/postcss@4.1.18': + '@tailwindcss/oxide-android-arm64': 4.3.0 + '@tailwindcss/oxide-darwin-arm64': 4.3.0 + '@tailwindcss/oxide-darwin-x64': 4.3.0 + '@tailwindcss/oxide-freebsd-x64': 4.3.0 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.3.0 + '@tailwindcss/oxide-linux-arm64-gnu': 4.3.0 + '@tailwindcss/oxide-linux-arm64-musl': 4.3.0 + '@tailwindcss/oxide-linux-x64-gnu': 4.3.0 + '@tailwindcss/oxide-linux-x64-musl': 4.3.0 + '@tailwindcss/oxide-wasm32-wasi': 4.3.0 + '@tailwindcss/oxide-win32-arm64-msvc': 4.3.0 + '@tailwindcss/oxide-win32-x64-msvc': 4.3.0 + + '@tailwindcss/postcss@4.3.0': dependencies: '@alloc/quick-lru': 5.2.0 - '@tailwindcss/node': 4.1.18 - '@tailwindcss/oxide': 4.1.18 - postcss: 8.5.6 - tailwindcss: 4.1.18 + '@tailwindcss/node': 4.3.0 + '@tailwindcss/oxide': 4.3.0 + postcss: 8.5.14 + tailwindcss: 4.3.0 - '@tailwindcss/typography@0.5.19(tailwindcss@4.1.18)': + '@tailwindcss/typography@0.5.19(tailwindcss@4.3.0)': dependencies: postcss-selector-parser: 6.0.10 - tailwindcss: 4.1.18 - - '@types/babel__core@7.20.5': - dependencies: - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 - '@types/babel__generator': 7.27.0 - '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.20.7 + tailwindcss: 4.3.0 - '@types/babel__generator@7.27.0': + '@tybys/wasm-util@0.10.2': dependencies: - '@babel/types': 7.28.5 - - '@types/babel__template@7.4.4': - dependencies: - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 - - '@types/babel__traverse@7.20.7': - dependencies: - '@babel/types': 7.28.5 + tslib: 2.8.1 + optional: true '@types/debug@4.1.12': dependencies: '@types/ms': 2.1.0 + '@types/esrecurse@4.3.1': {} + '@types/estree-jsx@1.0.5': dependencies: '@types/estree': 1.0.8 @@ -4777,17 +4784,17 @@ snapshots: '@types/ms@2.1.0': {} - '@types/node@25.0.2': + '@types/node@25.8.0': dependencies: - undici-types: 7.16.0 + undici-types: 7.24.6 '@types/picomatch@4.0.2': {} - '@types/react-dom@19.2.3(@types/react@19.2.7)': + '@types/react-dom@19.2.3(@types/react@19.2.14)': dependencies: - '@types/react': 19.2.7 + '@types/react': 19.2.14 - '@types/react@19.2.7': + '@types/react@19.2.14': dependencies: csstype: 3.2.3 @@ -4801,115 +4808,108 @@ snapshots: '@types/web-bluetooth@0.0.20': {} - '@typescript-eslint/eslint-plugin@8.49.0(@typescript-eslint/parser@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': + '@typescript-eslint/eslint-plugin@8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3))(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3)': dependencies: - '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/scope-manager': 8.49.0 - '@typescript-eslint/type-utils': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/utils': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.49.0 - eslint: 9.39.2(jiti@2.6.1) - ignore: 7.0.4 + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3) + '@typescript-eslint/scope-manager': 8.59.3 + '@typescript-eslint/type-utils': 8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3) + '@typescript-eslint/utils': 8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.59.3 + eslint: 10.4.0(jiti@2.6.1) + ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': + '@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3)': dependencies: - '@typescript-eslint/scope-manager': 8.49.0 - '@typescript-eslint/types': 8.49.0 - '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.49.0 + '@typescript-eslint/scope-manager': 8.59.3 + '@typescript-eslint/types': 8.59.3 + '@typescript-eslint/typescript-estree': 8.59.3(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.59.3 debug: 4.4.3 - eslint: 9.39.2(jiti@2.6.1) - typescript: 5.9.3 + eslint: 10.4.0(jiti@2.6.1) + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.49.0(typescript@5.9.3)': + '@typescript-eslint/project-service@8.59.3(typescript@6.0.3)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.49.0(typescript@5.9.3) - '@typescript-eslint/types': 8.49.0 + '@typescript-eslint/tsconfig-utils': 8.59.3(typescript@6.0.3) + '@typescript-eslint/types': 8.59.3 debug: 4.4.3 - typescript: 5.9.3 + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.49.0': + '@typescript-eslint/scope-manager@8.59.3': dependencies: - '@typescript-eslint/types': 8.49.0 - '@typescript-eslint/visitor-keys': 8.49.0 + '@typescript-eslint/types': 8.59.3 + '@typescript-eslint/visitor-keys': 8.59.3 - '@typescript-eslint/tsconfig-utils@8.49.0(typescript@5.9.3)': + '@typescript-eslint/tsconfig-utils@8.59.3(typescript@6.0.3)': dependencies: - typescript: 5.9.3 + typescript: 6.0.3 - '@typescript-eslint/type-utils@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': + '@typescript-eslint/type-utils@8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3)': dependencies: - '@typescript-eslint/types': 8.49.0 - '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/types': 8.59.3 + '@typescript-eslint/typescript-estree': 8.59.3(typescript@6.0.3) + '@typescript-eslint/utils': 8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3) debug: 4.4.3 - eslint: 9.39.2(jiti@2.6.1) - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + eslint: 10.4.0(jiti@2.6.1) + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.49.0': {} + '@typescript-eslint/types@8.59.3': {} - '@typescript-eslint/typescript-estree@8.49.0(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@8.59.3(typescript@6.0.3)': dependencies: - '@typescript-eslint/project-service': 8.49.0(typescript@5.9.3) - '@typescript-eslint/tsconfig-utils': 8.49.0(typescript@5.9.3) - '@typescript-eslint/types': 8.49.0 - '@typescript-eslint/visitor-keys': 8.49.0 + '@typescript-eslint/project-service': 8.59.3(typescript@6.0.3) + '@typescript-eslint/tsconfig-utils': 8.59.3(typescript@6.0.3) + '@typescript-eslint/types': 8.59.3 + '@typescript-eslint/visitor-keys': 8.59.3 debug: 4.4.3 - minimatch: 9.0.5 + minimatch: 10.2.5 semver: 7.7.3 tinyglobby: 0.2.15 - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': + '@typescript-eslint/utils@8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.39.2(jiti@2.6.1)) - '@typescript-eslint/scope-manager': 8.49.0 - '@typescript-eslint/types': 8.49.0 - '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) - eslint: 9.39.2(jiti@2.6.1) - typescript: 5.9.3 + '@eslint-community/eslint-utils': 4.9.1(eslint@10.4.0(jiti@2.6.1)) + '@typescript-eslint/scope-manager': 8.59.3 + '@typescript-eslint/types': 8.59.3 + '@typescript-eslint/typescript-estree': 8.59.3(typescript@6.0.3) + eslint: 10.4.0(jiti@2.6.1) + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.49.0': + '@typescript-eslint/visitor-keys@8.59.3': dependencies: - '@typescript-eslint/types': 8.49.0 - eslint-visitor-keys: 4.2.1 + '@typescript-eslint/types': 8.59.3 + eslint-visitor-keys: 5.0.1 '@ungap/structured-clone@1.3.0': {} - '@vitejs/plugin-react@5.1.2(vite@7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': + '@vitejs/plugin-react@6.0.2(vite@8.0.13(@types/node@25.8.0)(esbuild@0.28.0)(jiti@2.6.1)(terser@5.44.1)(tsx@4.22.0)(yaml@2.9.0))': dependencies: - '@babel/core': 7.28.5 - '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.5) - '@rolldown/pluginutils': 1.0.0-beta.53 - '@types/babel__core': 7.20.5 - react-refresh: 0.18.0 - vite: 7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) - transitivePeerDependencies: - - supports-color + '@rolldown/pluginutils': 1.0.1 + vite: 8.0.13(@types/node@25.8.0)(esbuild@0.28.0)(jiti@2.6.1)(terser@5.44.1)(tsx@4.22.0)(yaml@2.9.0) - '@vitejs/plugin-vue@5.2.1(vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3))': + '@vitejs/plugin-vue@5.2.1(vite@5.4.14(@types/node@25.8.0)(lightningcss@1.32.0)(terser@5.44.1))(vue@3.5.13(typescript@6.0.3))': dependencies: - vite: 5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1) - vue: 3.5.13(typescript@5.9.3) + vite: 5.4.14(@types/node@25.8.0)(lightningcss@1.32.0)(terser@5.44.1) + vue: 3.5.13(typescript@6.0.3) '@vue/compiler-core@3.5.13': dependencies: @@ -4973,30 +4973,30 @@ snapshots: '@vue/reactivity': 3.5.13 '@vue/runtime-core': 3.5.13 '@vue/shared': 3.5.13 - csstype: 3.1.3 + csstype: 3.2.3 - '@vue/server-renderer@3.5.13(vue@3.5.13(typescript@5.9.3))': + '@vue/server-renderer@3.5.13(vue@3.5.13(typescript@6.0.3))': dependencies: '@vue/compiler-ssr': 3.5.13 '@vue/shared': 3.5.13 - vue: 3.5.13(typescript@5.9.3) + vue: 3.5.13(typescript@6.0.3) '@vue/shared@3.5.13': {} - '@vueuse/core@12.5.0(typescript@5.9.3)': + '@vueuse/core@12.5.0(typescript@6.0.3)': dependencies: '@types/web-bluetooth': 0.0.20 '@vueuse/metadata': 12.5.0 - '@vueuse/shared': 12.5.0(typescript@5.9.3) - vue: 3.5.13(typescript@5.9.3) + '@vueuse/shared': 12.5.0(typescript@6.0.3) + vue: 3.5.13(typescript@6.0.3) transitivePeerDependencies: - typescript - '@vueuse/integrations@12.5.0(focus-trap@7.6.4)(typescript@5.9.3)': + '@vueuse/integrations@12.5.0(focus-trap@7.6.4)(typescript@6.0.3)': dependencies: - '@vueuse/core': 12.5.0(typescript@5.9.3) - '@vueuse/shared': 12.5.0(typescript@5.9.3) - vue: 3.5.13(typescript@5.9.3) + '@vueuse/core': 12.5.0(typescript@6.0.3) + '@vueuse/shared': 12.5.0(typescript@6.0.3) + vue: 3.5.13(typescript@6.0.3) optionalDependencies: focus-trap: 7.6.4 transitivePeerDependencies: @@ -5004,9 +5004,9 @@ snapshots: '@vueuse/metadata@12.5.0': {} - '@vueuse/shared@12.5.0(typescript@5.9.3)': + '@vueuse/shared@12.5.0(typescript@6.0.3)': dependencies: - vue: 3.5.13(typescript@5.9.3) + vue: 3.5.13(typescript@6.0.3) transitivePeerDependencies: - typescript @@ -5014,9 +5014,15 @@ snapshots: dependencies: acorn: 8.15.0 + acorn-jsx@5.3.2(acorn@8.16.0): + dependencies: + acorn: 8.16.0 + acorn@8.15.0: {} - ajv@6.12.6: + acorn@8.16.0: {} + + ajv@6.15.0: dependencies: fast-deep-equal: 3.1.3 fast-json-stable-stringify: 2.1.0 @@ -5045,32 +5051,23 @@ snapshots: ansi-regex@6.2.2: {} - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - ansi-styles@6.2.3: {} any-promise@1.3.0: {} - argparse@2.0.1: {} - astring@1.9.0: {} bail@2.0.2: {} - balanced-match@1.0.2: {} + balanced-match@4.0.4: {} - birpc@0.2.19: {} + baseline-browser-mapping@2.10.29: {} - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 + birpc@0.2.19: {} - brace-expansion@2.0.1: + brace-expansion@5.0.6: dependencies: - balanced-match: 1.0.2 + balanced-match: 4.0.4 braces@3.0.3: dependencies: @@ -5092,17 +5089,10 @@ snapshots: cac@6.7.14: {} - callsites@3.1.0: {} - caniuse-lite@1.0.30001718: {} ccount@2.0.1: {} - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - character-entities-html4@2.1.0: {} character-entities-legacy@3.0.0: {} @@ -5132,12 +5122,6 @@ snapshots: collapse-white-space@2.1.0: {} - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - colorette@2.0.20: {} comma-separated-tokens@2.0.3: {} @@ -5148,8 +5132,6 @@ snapshots: commander@4.1.1: {} - concat-map@0.0.1: {} - confbox@0.1.8: {} consola@3.4.2: {} @@ -5168,8 +5150,6 @@ snapshots: cssesc@3.0.0: {} - csstype@3.1.3: {} - csstype@3.2.3: {} debug@4.4.3: @@ -5198,10 +5178,10 @@ snapshots: emoji-regex@10.6.0: {} - enhanced-resolve@5.18.3: + enhanced-resolve@5.21.3: dependencies: graceful-fs: 4.2.11 - tapable: 2.2.2 + tapable: 2.3.3 entities@4.5.0: {} @@ -5249,35 +5229,6 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 - esbuild@0.25.12: - optionalDependencies: - '@esbuild/aix-ppc64': 0.25.12 - '@esbuild/android-arm': 0.25.12 - '@esbuild/android-arm64': 0.25.12 - '@esbuild/android-x64': 0.25.12 - '@esbuild/darwin-arm64': 0.25.12 - '@esbuild/darwin-x64': 0.25.12 - '@esbuild/freebsd-arm64': 0.25.12 - '@esbuild/freebsd-x64': 0.25.12 - '@esbuild/linux-arm': 0.25.12 - '@esbuild/linux-arm64': 0.25.12 - '@esbuild/linux-ia32': 0.25.12 - '@esbuild/linux-loong64': 0.25.12 - '@esbuild/linux-mips64el': 0.25.12 - '@esbuild/linux-ppc64': 0.25.12 - '@esbuild/linux-riscv64': 0.25.12 - '@esbuild/linux-s390x': 0.25.12 - '@esbuild/linux-x64': 0.25.12 - '@esbuild/netbsd-arm64': 0.25.12 - '@esbuild/netbsd-x64': 0.25.12 - '@esbuild/openbsd-arm64': 0.25.12 - '@esbuild/openbsd-x64': 0.25.12 - '@esbuild/openharmony-arm64': 0.25.12 - '@esbuild/sunos-x64': 0.25.12 - '@esbuild/win32-arm64': 0.25.12 - '@esbuild/win32-ia32': 0.25.12 - '@esbuild/win32-x64': 0.25.12 - esbuild@0.27.1: optionalDependencies: '@esbuild/aix-ppc64': 0.27.1 @@ -5307,59 +5258,87 @@ snapshots: '@esbuild/win32-ia32': 0.27.1 '@esbuild/win32-x64': 0.27.1 + esbuild@0.28.0: + optionalDependencies: + '@esbuild/aix-ppc64': 0.28.0 + '@esbuild/android-arm': 0.28.0 + '@esbuild/android-arm64': 0.28.0 + '@esbuild/android-x64': 0.28.0 + '@esbuild/darwin-arm64': 0.28.0 + '@esbuild/darwin-x64': 0.28.0 + '@esbuild/freebsd-arm64': 0.28.0 + '@esbuild/freebsd-x64': 0.28.0 + '@esbuild/linux-arm': 0.28.0 + '@esbuild/linux-arm64': 0.28.0 + '@esbuild/linux-ia32': 0.28.0 + '@esbuild/linux-loong64': 0.28.0 + '@esbuild/linux-mips64el': 0.28.0 + '@esbuild/linux-ppc64': 0.28.0 + '@esbuild/linux-riscv64': 0.28.0 + '@esbuild/linux-s390x': 0.28.0 + '@esbuild/linux-x64': 0.28.0 + '@esbuild/netbsd-arm64': 0.28.0 + '@esbuild/netbsd-x64': 0.28.0 + '@esbuild/openbsd-arm64': 0.28.0 + '@esbuild/openbsd-x64': 0.28.0 + '@esbuild/openharmony-arm64': 0.28.0 + '@esbuild/sunos-x64': 0.28.0 + '@esbuild/win32-arm64': 0.28.0 + '@esbuild/win32-ia32': 0.28.0 + '@esbuild/win32-x64': 0.28.0 + escalade@3.2.0: {} escape-string-regexp@4.0.0: {} escape-string-regexp@5.0.0: {} - eslint-plugin-react-hooks@7.0.1(eslint@9.39.2(jiti@2.6.1)): + eslint-plugin-react-hooks@7.1.1(eslint@10.4.0(jiti@2.6.1)): dependencies: - '@babel/core': 7.28.3 + '@babel/core': 7.28.5 '@babel/parser': 7.28.5 - eslint: 9.39.2(jiti@2.6.1) + eslint: 10.4.0(jiti@2.6.1) hermes-parser: 0.25.1 zod: 4.1.13 zod-validation-error: 4.0.2(zod@4.1.13) transitivePeerDependencies: - supports-color - eslint-plugin-react-refresh@0.4.25(eslint@9.39.2(jiti@2.6.1)): + eslint-plugin-react-refresh@0.5.2(eslint@10.4.0(jiti@2.6.1)): dependencies: - eslint: 9.39.2(jiti@2.6.1) + eslint: 10.4.0(jiti@2.6.1) - eslint-scope@8.4.0: + eslint-scope@9.1.2: dependencies: + '@types/esrecurse': 4.3.1 + '@types/estree': 1.0.8 esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.2.1: {} + eslint-visitor-keys@5.0.1: {} - eslint@9.39.2(jiti@2.6.1): + eslint@10.4.0(jiti@2.6.1): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) - '@eslint-community/regexpp': 4.12.1 - '@eslint/config-array': 0.21.1 - '@eslint/config-helpers': 0.4.2 - '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.1 - '@eslint/js': 9.39.2 - '@eslint/plugin-kit': 0.4.1 + '@eslint-community/eslint-utils': 4.9.0(eslint@10.4.0(jiti@2.6.1)) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.23.5 + '@eslint/config-helpers': 0.6.0 + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.1 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 '@types/estree': 1.0.8 - ajv: 6.12.6 - chalk: 4.1.2 + ajv: 6.15.0 cross-spawn: 7.0.6 debug: 4.4.3 escape-string-regexp: 4.0.0 - eslint-scope: 8.4.0 - eslint-visitor-keys: 4.2.1 - espree: 10.4.0 - esquery: 1.6.0 + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 + esquery: 1.7.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 8.0.0 @@ -5369,8 +5348,7 @@ snapshots: imurmurhash: 0.1.4 is-glob: 4.0.3 json-stable-stringify-without-jsonify: 1.0.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 + minimatch: 10.2.5 natural-compare: 1.4.0 optionator: 0.9.4 optionalDependencies: @@ -5378,13 +5356,13 @@ snapshots: transitivePeerDependencies: - supports-color - espree@10.4.0: + espree@11.2.0: dependencies: - acorn: 8.15.0 - acorn-jsx: 5.3.2(acorn@8.15.0) - eslint-visitor-keys: 4.2.1 + acorn: 8.16.0 + acorn-jsx: 5.3.2(acorn@8.16.0) + eslint-visitor-keys: 5.0.1 - esquery@1.6.0: + esquery@1.7.0: dependencies: estraverse: 5.3.0 @@ -5457,6 +5435,10 @@ snapshots: optionalDependencies: picomatch: 4.0.3 + fdir@6.5.0(picomatch@4.0.4): + optionalDependencies: + picomatch: 4.0.4 + file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -5494,10 +5476,6 @@ snapshots: get-east-asian-width@1.4.0: {} - get-tsconfig@4.13.0: - dependencies: - resolve-pkg-maps: 1.0.0 - github-slugger@2.0.0: {} glob-parent@5.1.2: @@ -5508,14 +5486,10 @@ snapshots: dependencies: is-glob: 4.0.3 - globals@14.0.0: {} - - globals@16.5.0: {} + globals@17.6.0: {} graceful-fs@4.2.11: {} - has-flag@4.0.0: {} - hast-util-from-html@2.0.3: dependencies: '@types/hast': 3.0.4 @@ -5649,12 +5623,7 @@ snapshots: ignore@5.3.2: {} - ignore@7.0.4: {} - - import-fresh@3.3.1: - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 + ignore@7.0.5: {} imurmurhash@0.1.4: {} @@ -5695,10 +5664,6 @@ snapshots: js-tokens@4.0.0: {} - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - jsesc@3.1.0: {} json-buffer@3.0.1: {} @@ -5718,54 +5683,54 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - lightningcss-android-arm64@1.30.2: + lightningcss-android-arm64@1.32.0: optional: true - lightningcss-darwin-arm64@1.30.2: + lightningcss-darwin-arm64@1.32.0: optional: true - lightningcss-darwin-x64@1.30.2: + lightningcss-darwin-x64@1.32.0: optional: true - lightningcss-freebsd-x64@1.30.2: + lightningcss-freebsd-x64@1.32.0: optional: true - lightningcss-linux-arm-gnueabihf@1.30.2: + lightningcss-linux-arm-gnueabihf@1.32.0: optional: true - lightningcss-linux-arm64-gnu@1.30.2: + lightningcss-linux-arm64-gnu@1.32.0: optional: true - lightningcss-linux-arm64-musl@1.30.2: + lightningcss-linux-arm64-musl@1.32.0: optional: true - lightningcss-linux-x64-gnu@1.30.2: + lightningcss-linux-x64-gnu@1.32.0: optional: true - lightningcss-linux-x64-musl@1.30.2: + lightningcss-linux-x64-musl@1.32.0: optional: true - lightningcss-win32-arm64-msvc@1.30.2: + lightningcss-win32-arm64-msvc@1.32.0: optional: true - lightningcss-win32-x64-msvc@1.30.2: + lightningcss-win32-x64-msvc@1.32.0: optional: true - lightningcss@1.30.2: + lightningcss@1.32.0: dependencies: detect-libc: 2.1.2 optionalDependencies: - lightningcss-android-arm64: 1.30.2 - lightningcss-darwin-arm64: 1.30.2 - lightningcss-darwin-x64: 1.30.2 - lightningcss-freebsd-x64: 1.30.2 - lightningcss-linux-arm-gnueabihf: 1.30.2 - lightningcss-linux-arm64-gnu: 1.30.2 - lightningcss-linux-arm64-musl: 1.30.2 - lightningcss-linux-x64-gnu: 1.30.2 - lightningcss-linux-x64-musl: 1.30.2 - lightningcss-win32-arm64-msvc: 1.30.2 - lightningcss-win32-x64-msvc: 1.30.2 + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 lilconfig@3.1.3: {} @@ -5796,8 +5761,6 @@ snapshots: dependencies: p-locate: 5.0.0 - lodash.merge@4.6.2: {} - log-update@6.1.0: dependencies: ansi-escapes: 7.2.0 @@ -6272,13 +6235,9 @@ snapshots: mimic-function@5.0.1: {} - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minimatch@9.0.5: + minimatch@10.2.5: dependencies: - brace-expansion: 2.0.1 + brace-expansion: 5.0.6 minisearch@7.1.1: {} @@ -6305,20 +6264,20 @@ snapshots: natural-compare@1.4.0: {} - next-themes@0.4.6(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + next-themes@0.4.6(react-dom@19.2.6(react@19.2.6))(react@19.2.6): dependencies: - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) - next@16.0.10(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + next@16.0.10(react-dom@19.2.6(react@19.2.6))(react@19.2.6): dependencies: '@next/env': 16.0.10 '@swc/helpers': 0.5.15 caniuse-lite: 1.0.30001718 postcss: 8.4.31 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - styled-jsx: 5.1.6(react@19.2.3) + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) + styled-jsx: 5.1.6(react@19.2.6) optionalDependencies: '@next/swc-darwin-arm64': 16.0.10 '@next/swc-darwin-x64': 16.0.10 @@ -6333,6 +6292,30 @@ snapshots: - '@babel/core' - babel-plugin-macros + next@16.2.6(react-dom@19.2.6(react@19.2.6))(react@19.2.6): + dependencies: + '@next/env': 16.2.6 + '@swc/helpers': 0.5.15 + baseline-browser-mapping: 2.10.29 + caniuse-lite: 1.0.30001718 + postcss: 8.4.31 + react: 19.2.6 + react-dom: 19.2.6(react@19.2.6) + styled-jsx: 5.1.6(react@19.2.6) + optionalDependencies: + '@next/swc-darwin-arm64': 16.2.6 + '@next/swc-darwin-x64': 16.2.6 + '@next/swc-linux-arm64-gnu': 16.2.6 + '@next/swc-linux-arm64-musl': 16.2.6 + '@next/swc-linux-x64-gnu': 16.2.6 + '@next/swc-linux-x64-musl': 16.2.6 + '@next/swc-win32-arm64-msvc': 16.2.6 + '@next/swc-win32-x64-msvc': 16.2.6 + sharp: 0.34.5 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + node-releases@2.0.19: {} object-assign@4.1.1: {} @@ -6378,10 +6361,6 @@ snapshots: dependencies: p-limit: 3.1.0 - parent-module@1.0.1: - dependencies: - callsites: 3.1.0 - parse-entities@4.0.2: dependencies: '@types/unist': 2.0.11 @@ -6412,6 +6391,8 @@ snapshots: picomatch@4.0.3: {} + picomatch@4.0.4: {} + pidtree@0.6.0: {} pirates@4.0.7: {} @@ -6422,14 +6403,14 @@ snapshots: mlly: 1.8.0 pathe: 2.0.3 - postcss-load-config@6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(yaml@2.8.2): + postcss-load-config@6.0.1(jiti@2.6.1)(postcss@8.5.14)(tsx@4.22.0)(yaml@2.9.0): dependencies: lilconfig: 3.1.3 optionalDependencies: jiti: 2.6.1 - postcss: 8.5.6 - tsx: 4.21.0 - yaml: 2.8.2 + postcss: 8.5.14 + tsx: 4.22.0 + yaml: 2.9.0 postcss-selector-parser@6.0.10: dependencies: @@ -6442,6 +6423,12 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + postcss@8.5.14: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + postcss@8.5.6: dependencies: nanoid: 3.3.11 @@ -6452,7 +6439,7 @@ snapshots: prelude-ls@1.2.1: {} - prettier@3.7.4: {} + prettier@3.8.3: {} property-information@7.1.0: {} @@ -6460,14 +6447,12 @@ snapshots: queue-microtask@1.2.3: {} - react-dom@19.2.3(react@19.2.3): + react-dom@19.2.6(react@19.2.6): dependencies: - react: 19.2.3 + react: 19.2.6 scheduler: 0.27.0 - react-refresh@0.18.0: {} - - react@19.2.3: {} + react@19.2.6: {} readdirp@4.1.2: {} @@ -6527,13 +6512,13 @@ snapshots: hast-util-from-html: 2.0.3 unified: 11.0.5 - rehype-pretty-code@0.14.1(shiki@3.20.0): + rehype-pretty-code@0.14.3(shiki@4.0.2): dependencies: '@types/hast': 3.0.4 hast-util-to-string: 3.0.1 parse-numeric-range: 1.3.0 rehype-parse: 9.0.1 - shiki: 3.20.0 + shiki: 4.0.2 unified: 11.0.5 unist-util-visit: 5.0.0 @@ -6598,12 +6583,8 @@ snapshots: mdast-util-to-markdown: 2.1.2 unified: 11.0.5 - resolve-from@4.0.0: {} - resolve-from@5.0.0: {} - resolve-pkg-maps@1.0.0: {} - restore-cursor@5.1.0: dependencies: onetime: 7.0.0 @@ -6613,6 +6594,27 @@ snapshots: rfdc@1.4.1: {} + rolldown@1.0.1: + dependencies: + '@oxc-project/types': 0.130.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.1 + '@rolldown/binding-darwin-arm64': 1.0.1 + '@rolldown/binding-darwin-x64': 1.0.1 + '@rolldown/binding-freebsd-x64': 1.0.1 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.1 + '@rolldown/binding-linux-arm64-gnu': 1.0.1 + '@rolldown/binding-linux-arm64-musl': 1.0.1 + '@rolldown/binding-linux-ppc64-gnu': 1.0.1 + '@rolldown/binding-linux-s390x-gnu': 1.0.1 + '@rolldown/binding-linux-x64-gnu': 1.0.1 + '@rolldown/binding-linux-x64-musl': 1.0.1 + '@rolldown/binding-openharmony-arm64': 1.0.1 + '@rolldown/binding-wasm32-wasi': 1.0.1 + '@rolldown/binding-win32-arm64-msvc': 1.0.1 + '@rolldown/binding-win32-x64-msvc': 1.0.1 + rollup@4.41.0: dependencies: '@types/estree': 1.0.7 @@ -6639,32 +6641,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.41.0 fsevents: 2.3.3 - rollup@4.48.1: - dependencies: - '@types/estree': 1.0.8 - optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.48.1 - '@rollup/rollup-android-arm64': 4.48.1 - '@rollup/rollup-darwin-arm64': 4.48.1 - '@rollup/rollup-darwin-x64': 4.48.1 - '@rollup/rollup-freebsd-arm64': 4.48.1 - '@rollup/rollup-freebsd-x64': 4.48.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.48.1 - '@rollup/rollup-linux-arm-musleabihf': 4.48.1 - '@rollup/rollup-linux-arm64-gnu': 4.48.1 - '@rollup/rollup-linux-arm64-musl': 4.48.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.48.1 - '@rollup/rollup-linux-ppc64-gnu': 4.48.1 - '@rollup/rollup-linux-riscv64-gnu': 4.48.1 - '@rollup/rollup-linux-riscv64-musl': 4.48.1 - '@rollup/rollup-linux-s390x-gnu': 4.48.1 - '@rollup/rollup-linux-x64-gnu': 4.48.1 - '@rollup/rollup-linux-x64-musl': 4.48.1 - '@rollup/rollup-win32-arm64-msvc': 4.48.1 - '@rollup/rollup-win32-ia32-msvc': 4.48.1 - '@rollup/rollup-win32-x64-msvc': 4.48.1 - fsevents: 2.3.3 - rollup@4.53.3: dependencies: '@types/estree': 1.0.8 @@ -6753,14 +6729,14 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 - shiki@3.20.0: + shiki@4.0.2: dependencies: - '@shikijs/core': 3.20.0 - '@shikijs/engine-javascript': 3.20.0 - '@shikijs/engine-oniguruma': 3.20.0 - '@shikijs/langs': 3.20.0 - '@shikijs/themes': 3.20.0 - '@shikijs/types': 3.20.0 + '@shikijs/core': 4.0.2 + '@shikijs/engine-javascript': 4.0.2 + '@shikijs/engine-oniguruma': 4.0.2 + '@shikijs/langs': 4.0.2 + '@shikijs/themes': 4.0.2 + '@shikijs/types': 4.0.2 '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 @@ -6816,8 +6792,6 @@ snapshots: dependencies: ansi-regex: 6.2.2 - strip-json-comments@3.1.1: {} - style-to-js@1.1.21: dependencies: style-to-object: 1.0.14 @@ -6826,10 +6800,10 @@ snapshots: dependencies: inline-style-parser: 0.2.7 - styled-jsx@5.1.6(react@19.2.3): + styled-jsx@5.1.6(react@19.2.6): dependencies: client-only: 0.0.1 - react: 19.2.3 + react: 19.2.6 sucrase@3.35.1: dependencies: @@ -6845,17 +6819,13 @@ snapshots: dependencies: copy-anything: 3.0.5 - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - supports-color@9.4.0: {} tabbable@6.2.0: {} - tailwindcss@4.1.18: {} + tailwindcss@4.3.0: {} - tapable@2.2.2: {} + tapable@2.3.3: {} terser@5.44.1: dependencies: @@ -6874,15 +6844,15 @@ snapshots: tinyexec@0.3.2: {} - tinyglobby@0.2.14: + tinyglobby@0.2.15: dependencies: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 - tinyglobby@0.2.15: + tinyglobby@0.2.16: dependencies: - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 to-regex-range@5.0.1: dependencies: @@ -6894,15 +6864,15 @@ snapshots: trough@2.2.0: {} - ts-api-utils@2.1.0(typescript@5.9.3): + ts-api-utils@2.5.0(typescript@6.0.3): dependencies: - typescript: 5.9.3 + typescript: 6.0.3 ts-interface-checker@0.1.13: {} tslib@2.8.1: {} - tsup@8.5.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.2): + tsup@8.5.1(jiti@2.6.1)(postcss@8.5.14)(tsx@4.22.0)(typescript@6.0.3)(yaml@2.9.0): dependencies: bundle-require: 5.1.0(esbuild@0.27.1) cac: 6.7.14 @@ -6913,7 +6883,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(yaml@2.8.2) + postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.14)(tsx@4.22.0)(yaml@2.9.0) resolve-from: 5.0.0 rollup: 4.53.3 source-map: 0.7.6 @@ -6922,18 +6892,17 @@ snapshots: tinyglobby: 0.2.15 tree-kill: 1.2.2 optionalDependencies: - postcss: 8.5.6 - typescript: 5.9.3 + postcss: 8.5.14 + typescript: 6.0.3 transitivePeerDependencies: - jiti - supports-color - tsx - yaml - tsx@4.21.0: + tsx@4.22.0: dependencies: - esbuild: 0.27.1 - get-tsconfig: 4.13.0 + esbuild: 0.28.0 optionalDependencies: fsevents: 2.3.3 @@ -6941,22 +6910,22 @@ snapshots: dependencies: prelude-ls: 1.2.1 - typescript-eslint@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3): + typescript-eslint@8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.49.0(@typescript-eslint/parser@8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/parser': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/typescript-estree': 8.49.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.49.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) - eslint: 9.39.2(jiti@2.6.1) - typescript: 5.9.3 + '@typescript-eslint/eslint-plugin': 8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3))(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3) + '@typescript-eslint/parser': 8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3) + '@typescript-eslint/typescript-estree': 8.59.3(typescript@6.0.3) + '@typescript-eslint/utils': 8.59.3(eslint@10.4.0(jiti@2.6.1))(typescript@6.0.3) + eslint: 10.4.0(jiti@2.6.1) + typescript: 6.0.3 transitivePeerDependencies: - supports-color - typescript@5.9.3: {} + typescript@6.0.3: {} ufo@1.6.1: {} - undici-types@7.16.0: {} + undici-types@7.24.6: {} unified@11.0.5: dependencies: @@ -7043,52 +7012,34 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1): + vite@5.4.14(@types/node@25.8.0)(lightningcss@1.32.0)(terser@5.44.1): dependencies: esbuild: 0.21.5 postcss: 8.5.6 rollup: 4.41.0 optionalDependencies: - '@types/node': 25.0.2 - fsevents: 2.3.3 - lightningcss: 1.30.2 - terser: 5.44.1 - - vite@7.1.3(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): - dependencies: - esbuild: 0.25.12 - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 - postcss: 8.5.6 - rollup: 4.48.1 - tinyglobby: 0.2.14 - optionalDependencies: - '@types/node': 25.0.2 + '@types/node': 25.8.0 fsevents: 2.3.3 - jiti: 2.6.1 - lightningcss: 1.30.2 + lightningcss: 1.32.0 terser: 5.44.1 - tsx: 4.21.0 - yaml: 2.8.2 - vite@7.2.7(@types/node@25.0.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2): + vite@8.0.13(@types/node@25.8.0)(esbuild@0.28.0)(jiti@2.6.1)(terser@5.44.1)(tsx@4.22.0)(yaml@2.9.0): dependencies: - esbuild: 0.25.12 - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 - postcss: 8.5.6 - rollup: 4.53.3 - tinyglobby: 0.2.15 + lightningcss: 1.32.0 + picomatch: 4.0.4 + postcss: 8.5.14 + rolldown: 1.0.1 + tinyglobby: 0.2.16 optionalDependencies: - '@types/node': 25.0.2 + '@types/node': 25.8.0 + esbuild: 0.28.0 fsevents: 2.3.3 jiti: 2.6.1 - lightningcss: 1.30.2 terser: 5.44.1 - tsx: 4.21.0 - yaml: 2.8.2 + tsx: 4.22.0 + yaml: 2.9.0 - vitepress@1.6.4(@algolia/client-search@5.20.0)(@types/node@25.0.2)(lightningcss@1.30.2)(postcss@8.5.6)(search-insights@2.17.3)(terser@5.44.1)(typescript@5.9.3): + vitepress@1.6.4(@algolia/client-search@5.20.0)(@types/node@25.8.0)(lightningcss@1.32.0)(postcss@8.5.14)(search-insights@2.17.3)(terser@5.44.1)(typescript@6.0.3): dependencies: '@docsearch/css': 3.8.2 '@docsearch/js': 3.8.2(@algolia/client-search@5.20.0)(search-insights@2.17.3) @@ -7097,19 +7048,19 @@ snapshots: '@shikijs/transformers': 2.1.0 '@shikijs/types': 2.5.0 '@types/markdown-it': 14.1.2 - '@vitejs/plugin-vue': 5.2.1(vite@5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1))(vue@3.5.13(typescript@5.9.3)) + '@vitejs/plugin-vue': 5.2.1(vite@5.4.14(@types/node@25.8.0)(lightningcss@1.32.0)(terser@5.44.1))(vue@3.5.13(typescript@6.0.3)) '@vue/devtools-api': 7.7.0 '@vue/shared': 3.5.13 - '@vueuse/core': 12.5.0(typescript@5.9.3) - '@vueuse/integrations': 12.5.0(focus-trap@7.6.4)(typescript@5.9.3) + '@vueuse/core': 12.5.0(typescript@6.0.3) + '@vueuse/integrations': 12.5.0(focus-trap@7.6.4)(typescript@6.0.3) focus-trap: 7.6.4 mark.js: 8.11.1 minisearch: 7.1.1 shiki: 2.5.0 - vite: 5.4.14(@types/node@25.0.2)(lightningcss@1.30.2)(terser@5.44.1) - vue: 3.5.13(typescript@5.9.3) + vite: 5.4.14(@types/node@25.8.0)(lightningcss@1.32.0)(terser@5.44.1) + vue: 3.5.13(typescript@6.0.3) optionalDependencies: - postcss: 8.5.6 + postcss: 8.5.14 transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -7137,15 +7088,15 @@ snapshots: - typescript - universal-cookie - vue@3.5.13(typescript@5.9.3): + vue@3.5.13(typescript@6.0.3): dependencies: '@vue/compiler-dom': 3.5.13 '@vue/compiler-sfc': 3.5.13 '@vue/runtime-dom': 3.5.13 - '@vue/server-renderer': 3.5.13(vue@3.5.13(typescript@5.9.3)) + '@vue/server-renderer': 3.5.13(vue@3.5.13(typescript@6.0.3)) '@vue/shared': 3.5.13 optionalDependencies: - typescript: 5.9.3 + typescript: 6.0.3 web-namespaces@2.0.1: {} @@ -7165,6 +7116,8 @@ snapshots: yaml@2.8.2: {} + yaml@2.9.0: {} + yocto-queue@0.1.0: {} zod-validation-error@4.0.2(zod@4.1.13): @@ -7173,4 +7126,6 @@ snapshots: zod@4.1.13: {} + zod@4.4.3: {} + zwitch@2.0.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 32e312f9..9b1d7471 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,7 +2,7 @@ packages: - docs - examples/* - packages/* -onlyBuiltDependencies: - - esbuild - - sharp - - simple-git-hooks +allowBuilds: + esbuild: true + sharp: true + simple-git-hooks: true diff --git a/src/schemas/excerpt.ts b/src/schemas/excerpt.ts index 6b89d606..bf4ebe52 100644 --- a/src/schemas/excerpt.ts +++ b/src/schemas/excerpt.ts @@ -18,12 +18,14 @@ export interface ExcerptOptions { } export const excerpt = ({ length = 260 }: ExcerptOptions = {}) => - custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - value = value ?? context().file.plain - if (value == null || value.length === 0) { - ctx.addIssue({ code: 'custom', message: 'The content is empty' }) - return '' - } + custom(i => typeof i === 'string') + .optional() + .transform(async (value, ctx) => { + value = value ?? context().file.plain + if (value == null || value.length === 0) { + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) + return '' + } - return value.slice(0, length) - }) + return value.slice(0, length) + }) diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 9964e27c..3fe01d23 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -29,4 +29,8 @@ export const s = { unique } as const -export type Schema = z.ZodType +export { z } + +export type Schema = z.ZodType +export type ZodType = z.ZodType +export type infer = z.infer diff --git a/src/schemas/markdown.ts b/src/schemas/markdown.ts index 42d18a2a..bc507c5a 100644 --- a/src/schemas/markdown.ts +++ b/src/schemas/markdown.ts @@ -40,44 +40,46 @@ const rehypeMetaString = () => (tree: Hast) => { } export const markdown = (options: MarkdownOptions = {}) => - custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - const { file, config } = context() - value = value ?? file.content - if (value == null || value.length === 0) { - ctx.addIssue({ code: 'custom', message: 'The content is empty' }) - return '' - } + custom(i => typeof i === 'string') + .optional() + .transform(async (value, ctx) => { + const { file, config } = context() + value = value ?? file.content + if (value == null || value.length === 0) { + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) + return '' + } - const { markdown, output } = config + const { markdown, output } = config - const enableGfm = options.gfm ?? markdown?.gfm ?? true - const removeComments = options.removeComments ?? markdown?.removeComments ?? true - const copyLinkedFiles = options.copyLinkedFiles ?? markdown?.copyLinkedFiles ?? true + const enableGfm = options.gfm ?? markdown?.gfm ?? true + const removeComments = options.removeComments ?? markdown?.removeComments ?? true + const copyLinkedFiles = options.copyLinkedFiles ?? markdown?.copyLinkedFiles ?? true - const remarkPlugins = [] as PluggableList - const rehypePlugins = [] as PluggableList + const remarkPlugins = [] as PluggableList + const rehypePlugins = [] as PluggableList - if (enableGfm) remarkPlugins.push(remarkGfm) // support gfm (autolink literals, footnotes, strikethrough, tables, tasklists). - if (removeComments) remarkPlugins.push(remarkRemoveComments) // remove html comments - if (copyLinkedFiles) rehypePlugins.push([rehypeCopyLinkedFiles, output]) // copy linked files to public path and replace their urls with public urls - if (options.remarkPlugins != null) remarkPlugins.push(...options.remarkPlugins) // apply remark plugins - if (options.rehypePlugins != null) rehypePlugins.push(...options.rehypePlugins) // apply rehype plugins - if (markdown?.remarkPlugins != null) remarkPlugins.push(...markdown.remarkPlugins) // apply global remark plugins - if (markdown?.rehypePlugins != null) rehypePlugins.push(...markdown.rehypePlugins) // apply global rehype plugins + if (enableGfm) remarkPlugins.push(remarkGfm) // support gfm (autolink literals, footnotes, strikethrough, tables, tasklists). + if (removeComments) remarkPlugins.push(remarkRemoveComments) // remove html comments + if (copyLinkedFiles) rehypePlugins.push([rehypeCopyLinkedFiles, output]) // copy linked files to public path and replace their urls with public urls + if (options.remarkPlugins != null) remarkPlugins.push(...options.remarkPlugins) // apply remark plugins + if (options.rehypePlugins != null) rehypePlugins.push(...options.rehypePlugins) // apply rehype plugins + if (markdown?.remarkPlugins != null) remarkPlugins.push(...markdown.remarkPlugins) // apply global remark plugins + if (markdown?.rehypePlugins != null) rehypePlugins.push(...markdown.rehypePlugins) // apply global rehype plugins - try { - const html = await unified() - .use(remarkParse) // parse markdown content to a syntax tree - .use(remarkPlugins) // apply remark plugins - .use(remarkRehype, { allowDangerousHtml: true }) - .use(rehypeMetaString) // ensure `data.meta` is preserved in `properties.metastring` for rehype syntax highlighters - .use(rehypeRaw) // turn markdown syntax tree to html syntax tree, with raw html support - .use(rehypePlugins) // apply rehype plugins - .use(rehypeStringify) // serialize html syntax tree - .process({ value, path: file.path }) - return html.toString() - } catch (err: any) { - ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) - return null as never - } - }) + try { + const html = await unified() + .use(remarkParse) // parse markdown content to a syntax tree + .use(remarkPlugins) // apply remark plugins + .use(remarkRehype, { allowDangerousHtml: true }) + .use(rehypeMetaString) // ensure `data.meta` is preserved in `properties.metastring` for rehype syntax highlighters + .use(rehypeRaw) // turn markdown syntax tree to html syntax tree, with raw html support + .use(rehypePlugins) // apply rehype plugins + .use(rehypeStringify) // serialize html syntax tree + .process({ value, path: file.path }) + return html.toString() + } catch (err: any) { + ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) + return null as never + } + }) diff --git a/src/schemas/mdx.ts b/src/schemas/mdx.ts index 7ac7f586..c6e257a8 100644 --- a/src/schemas/mdx.ts +++ b/src/schemas/mdx.ts @@ -19,53 +19,55 @@ const remarkRemoveComments = () => (tree: Root) => { } export const mdx = (options: MdxOptions = {}) => - custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - const { file, config } = context() - value = value ?? file.content - if (value == null || value.length === 0) { - ctx.addIssue({ code: 'custom', message: 'The content is empty' }) - return '' - } + custom(i => typeof i === 'string') + .optional() + .transform(async (value, ctx) => { + const { file, config } = context() + value = value ?? file.content + if (value == null || value.length === 0) { + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) + return '' + } - const { mdx, output } = config + const { mdx, output } = config - const enableGfm = options.gfm ?? mdx?.gfm ?? true - const enableMinify = options.minify ?? mdx?.minify ?? true - const removeComments = options.removeComments ?? mdx?.removeComments ?? true - const copyLinkedFiles = options.copyLinkedFiles ?? mdx?.copyLinkedFiles ?? true - const outputFormat = options.outputFormat ?? mdx?.outputFormat ?? 'function-body' + const enableGfm = options.gfm ?? mdx?.gfm ?? true + const enableMinify = options.minify ?? mdx?.minify ?? true + const removeComments = options.removeComments ?? mdx?.removeComments ?? true + const copyLinkedFiles = options.copyLinkedFiles ?? mdx?.copyLinkedFiles ?? true + const outputFormat = options.outputFormat ?? mdx?.outputFormat ?? 'function-body' - const remarkPlugins = [] as PluggableList - const rehypePlugins = [] as PluggableList + const remarkPlugins = [] as PluggableList + const rehypePlugins = [] as PluggableList - if (enableGfm) remarkPlugins.push(remarkGfm) // support gfm (autolink literals, footnotes, strikethrough, tables, tasklists). - if (removeComments) remarkPlugins.push(remarkRemoveComments) // remove html comments - if (copyLinkedFiles) remarkPlugins.push([remarkCopyLinkedFiles, output]) // copy linked files to public path and replace their urls with public urls - if (options.remarkPlugins != null) remarkPlugins.push(...options.remarkPlugins) // apply remark plugins - if (options.rehypePlugins != null) rehypePlugins.push(...options.rehypePlugins) // apply rehype plugins - if (mdx?.remarkPlugins != null) remarkPlugins.push(...mdx.remarkPlugins) // apply global remark plugins - if (mdx?.rehypePlugins != null) rehypePlugins.push(...mdx.rehypePlugins) // apply global rehype plugins + if (enableGfm) remarkPlugins.push(remarkGfm) // support gfm (autolink literals, footnotes, strikethrough, tables, tasklists). + if (removeComments) remarkPlugins.push(remarkRemoveComments) // remove html comments + if (copyLinkedFiles) remarkPlugins.push([remarkCopyLinkedFiles, output]) // copy linked files to public path and replace their urls with public urls + if (options.remarkPlugins != null) remarkPlugins.push(...options.remarkPlugins) // apply remark plugins + if (options.rehypePlugins != null) rehypePlugins.push(...options.rehypePlugins) // apply rehype plugins + if (mdx?.remarkPlugins != null) remarkPlugins.push(...mdx.remarkPlugins) // apply global remark plugins + if (mdx?.rehypePlugins != null) rehypePlugins.push(...mdx.rehypePlugins) // apply global rehype plugins - const compilerOptions = { ...mdx, ...options, outputFormat, remarkPlugins, rehypePlugins } + const compilerOptions = { ...mdx, ...options, outputFormat, remarkPlugins, rehypePlugins } - const { compile } = await import('@mdx-js/mdx') + const { compile } = await import('@mdx-js/mdx') - try { - const code = await compile({ value, path: file.path }, compilerOptions) + try { + const code = await compile({ value, path: file.path }, compilerOptions) - if (!enableMinify) return code.toString() + if (!enableMinify) return code.toString() - const { minify } = await import('terser') - const minified = await minify(code.toString(), { - module: true, - compress: true, - keep_classnames: true, - mangle: { keep_fnames: true }, - parse: { bare_returns: true } - }) - return minified.code ?? code.toString() - } catch (err: any) { - ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) - return null as never - } - }) + const { minify } = await import('terser') + const minified = await minify(code.toString(), { + module: true, + compress: true, + keep_classnames: true, + mangle: { keep_fnames: true }, + parse: { bare_returns: true } + }) + return minified.code ?? code.toString() + } catch (err: any) { + ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) + return null as never + } + }) diff --git a/src/schemas/metadata.ts b/src/schemas/metadata.ts index a3480b23..8087d5a7 100644 --- a/src/schemas/metadata.ts +++ b/src/schemas/metadata.ts @@ -62,35 +62,37 @@ export interface Metadata { } export const metadata = () => - custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - value = value ?? context().file.plain - if (value == null || value.length === 0) { - ctx.addIssue({ code: 'custom', message: 'The content is empty' }) - return { readingTime: 0, wordCount: 0 } - } + custom(i => typeof i === 'string') + .optional() + .transform(async (value, ctx) => { + value = value ?? context().file.plain + if (value == null || value.length === 0) { + ctx.addIssue({ code: 'custom', message: 'The content is empty' }) + return { readingTime: 0, wordCount: 0 } + } - // https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-transformer-remark/src/utils/time-to-read.js - const avgWPM = 265 + // https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-transformer-remark/src/utils/time-to-read.js + const avgWPM = 265 - const latinChars = [] - const cjChars = [] + const latinChars = [] + const cjChars = [] - for (const char of value) { - if (isCjChar(char)) { - cjChars.push(char) - } else { - latinChars.push(char) + for (const char of value) { + if (isCjChar(char)) { + cjChars.push(char) + } else { + latinChars.push(char) + } } - } - // Multiply non-latin character string length by 0.56, because - // on average one word consists of 2 characters in both Chinese and Japanese - const wordCount = wordLength(latinChars.join('')) + cjChars.length * 0.56 + // Multiply non-latin character string length by 0.56, because + // on average one word consists of 2 characters in both Chinese and Japanese + const wordCount = wordLength(latinChars.join('')) + cjChars.length * 0.56 - const time = Math.round(wordCount / avgWPM) + const time = Math.round(wordCount / avgWPM) - return { - readingTime: time === 0 ? 1 : time, - wordCount: wordCount - } - }) + return { + readingTime: time === 0 ? 1 : time, + wordCount: wordCount + } + }) diff --git a/src/schemas/path.ts b/src/schemas/path.ts index 0c08fe0e..445e3254 100644 --- a/src/schemas/path.ts +++ b/src/schemas/path.ts @@ -24,16 +24,14 @@ export interface PathOptions { * @returns flattened path based on the file path */ export const path = (options?: PathOptions) => - custom(i => i === undefined || typeof i === 'string').transform(async (value, ctx) => { - if (value != null) { - ctx.addIssue({ fatal: false, code: 'custom', message: '`s.path()` schema will resolve the flattening path based on the file path' }) - } + custom(i => typeof i === 'string') + .optional() + .transform(async () => { + const { config, file } = context() - const { config, file } = context() + const flattened = relative(config.root, file.path) + .replace(/\.[^.]+$/, '') + .replace(/\\/g, '/') - const flattened = relative(config.root, file.path) - .replace(/\.[^.]+$/, '') - .replace(/\\/g, '/') - - return options?.removeIndex === false ? flattened : flattened.replace(/\/index$/, '') - }) + return options?.removeIndex === false ? flattened : flattened.replace(/\/index$/, '') + }) diff --git a/src/schemas/raw.ts b/src/schemas/raw.ts index 142d5f6f..c3e7c31f 100644 --- a/src/schemas/raw.ts +++ b/src/schemas/raw.ts @@ -3,6 +3,8 @@ import { custom } from 'zod' import { context } from '../context' export const raw = () => - custom(i => i === undefined || typeof i === 'string').transform(value => { - return value ?? context().file.content ?? '' - }) + custom(i => typeof i === 'string') + .optional() + .transform(value => { + return value ?? context().file.content ?? '' + }) diff --git a/src/schemas/toc.ts b/src/schemas/toc.ts index c91a4762..274b08c1 100644 --- a/src/schemas/toc.ts +++ b/src/schemas/toc.ts @@ -99,8 +99,9 @@ const parse = (tree?: List): TocEntry[] => { } export const toc = (options?: T) => - custom(i => i === undefined || typeof i === 'string').transform( - async (value, ctx) => { + custom(i => typeof i === 'string') + .optional() + .transform(async (value, ctx) => { const { file } = context() value = value ?? file.content if (value == null || value.length === 0) { @@ -117,5 +118,4 @@ export const toc = (options?: T) => ctx.addIssue({ fatal: true, code: 'custom', message: err.message }) return null as never } - } - ) + }) diff --git a/test/schema.ts b/test/schema.ts new file mode 100644 index 00000000..1aa281e4 --- /dev/null +++ b/test/schema.ts @@ -0,0 +1,39 @@ +import { equal } from 'node:assert' +import { test } from 'node:test' + +import { parseWithContext, s, z } from '../src' + +import type { Schema } from '../src' + +test('exports zod utilities from the public entry', () => { + equal(typeof z.string, 'function') +}) + +test('Schema accepts an output type parameter', () => { + const schema: Schema = z.string() + equal(schema.parse('hello'), 'hello') +}) + +test('s.path resolves file path even when input is present', async () => { + const result = await parseWithContext(s.path(), 'manual-value', { + config: { root: '/site/content' } as any, + file: { path: '/site/content/posts/hello.md' } as any + }) + + equal(result.success, true) + if (result.success) equal(result.data, 'posts/hello') +}) + +test('context schemas resolve missing object fields from the current file', async () => { + const result = await parseWithContext( + s.object({ raw: s.raw() }), + {}, + { + config: { root: '/site/content' } as any, + file: { content: 'Hello from file', path: '/site/content/pages/about.mdx' } as any + } + ) + + equal(result.success, true) + equal((result.data as any).raw, 'Hello from file') +}) diff --git a/tsconfig.json b/tsconfig.json index 7e9a26f2..e2ca2a40 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "module": "es2022", "moduleResolution": "bundler", "esModuleInterop": true, + "ignoreDeprecations": "6.0", "skipLibCheck": true, "noEmit": true, "strict": true From 5104c7f9c09b08c34c55d2fa0fe8995983a95029 Mon Sep 17 00:00:00 2001 From: zce Date: Sat, 16 May 2026 17:35:15 +0800 Subject: [PATCH 13/48] docs: add alpha migration guide --- docs/.vitepress/config.ts | 1 + docs/guide/migration.md | 203 ++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 docs/guide/migration.md diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 1e8f9521..bf1434d4 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -52,6 +52,7 @@ export default defineConfig({ items: [ { text: 'Introduction', link: 'introduction' }, { text: 'Quick Start', link: 'quick-start' }, + { text: 'Migration to 1.0 Alpha', link: 'migration' }, { text: 'Define Collections', link: 'define-collections' }, { text: 'Using Collections', link: 'using-collections' }, { text: 'Velite Schemas', link: 'velite-schemas' } diff --git a/docs/guide/migration.md b/docs/guide/migration.md new file mode 100644 index 00000000..7e451220 --- /dev/null +++ b/docs/guide/migration.md @@ -0,0 +1,203 @@ +# Migration to 1.0 Alpha + +Velite 1.0 alpha modernizes the parser pipeline around Zod 4 and introduces framework plugins for app integrations. This guide covers the changes you should apply when upgrading from `0.3.x` or an earlier `1.0.0-alpha` build. + +## Upgrade Packages + +Install the alpha release and update your package manager lockfile: + +```bash +pnpm add -D velite@1.0.0-alpha.2 +``` + +If you use the framework plugins, install the matching package: + +```bash +pnpm add -D @velite/plugin-next@latest +pnpm add -D @velite/plugin-vite@latest +``` + +## Runtime Requirements + +Velite now targets Node.js `>=20.19.0`. + +This aligns the package with current versions of the runtime dependencies used by the build and watch pipeline. Update local development, CI, and deployment environments before upgrading. + +## Zod 4 Schema Semantics + +Velite now uses the official `zod` package directly. The `s` helper still includes Velite-specific schemas and all Zod exports, and `z` is also exported from `velite` for code that prefers the Zod namespace. + +```ts +import { s, z } from 'velite' + +const post = s.object({ + title: z.string(), + slug: s.path() +}) +``` + +### Replace `ctx.meta` With `context()` + +The parser no longer passes Velite file metadata through Zod's transform context. Use `context()` to access the current file and resolved config. + +Before: + +```ts +import { defineSchema, s } from 'velite' + +export const sourcePath = defineSchema(() => + s.custom().transform((value, { meta }) => { + return value ?? meta.path + }) +) +``` + +After: + +```ts +import { context, defineSchema, s } from 'velite' + +export const sourcePath = defineSchema(() => + s + .custom(value => typeof value === 'string') + .optional() + .transform(value => { + return value ?? context().file.path + }) +) +``` + +The `context()` function returns: + +```ts +{ + config: Config + file: VeliteFile +} +``` + +### Mark Context-Derived Fields as Optional + +In Zod 4, object keys are required unless the schema is explicitly optional. If a field is usually missing from frontmatter and should be derived from the current file, add `.optional()` before `.transform()`. + +Before: + +```ts +const posts = defineCollection({ + schema: s.object({ + content: s.custom().transform(value => value ?? context().file.content ?? '') + }) +}) +``` + +After: + +```ts +const posts = defineCollection({ + schema: s.object({ + content: s + .custom(value => typeof value === 'string') + .optional() + .transform(value => value ?? context().file.content ?? '') + }) +}) +``` + +Velite's built-in context-derived schemas already follow this pattern, including `s.path()`, `s.raw()`, `s.markdown()`, `s.mdx()`, `s.excerpt()`, `s.metadata()`, and `s.toc()`. + +### Do Not Use `addIssue()` for Warnings + +Zod 4 treats any `ctx.addIssue()` call as a validation failure. `fatal: false` does not mean "warning" and does not keep the parse result successful. + +Before: + +```ts +s.string().transform((value, ctx) => { + ctx.addIssue({ fatal: false, code: 'custom', message: 'Using fallback value' }) + return value +}) +``` + +After: + +```ts +s.string().transform(value => { + return value +}) +``` + +Only call `ctx.addIssue()` when the current value should fail validation. + +## Next.js Integration + +Use `@velite/plugin-next` instead of manually starting Velite from `next.config.ts`. + +Before: + +```ts +const isDev = process.argv.includes('dev') +const isBuild = process.argv.includes('build') + +if (!process.env.VELITE_STARTED && (isDev || isBuild)) { + process.env.VELITE_STARTED = '1' + import('velite').then(m => m.build({ watch: isDev, clean: !isDev })) +} + +export default {} +``` + +After: + +```ts +import { withVelite } from '@velite/plugin-next' + +export default withVelite() +``` + +To pass Velite options: + +```ts +import { createNextPlugin } from '@velite/plugin-next' + +const withVelite = createNextPlugin({ config: './velite.config.ts' }) + +export default withVelite({ + reactStrictMode: true +}) +``` + +## Vite Integration + +`@velite/plugin-vite` supports Vite 5 through Vite 8. Keep the plugin in your Vite config and upgrade Vite normally: + +```ts +import { velite } from '@velite/plugin-vite' +import react from '@vitejs/plugin-react' +import { defineConfig } from 'vite' + +export default defineConfig({ + plugins: [velite(), react()] +}) +``` + +## Type Exports + +The public entry exports Zod-related helpers for schema typing: + +```ts +import { z } from 'velite' + +import type { infer, Schema, ZodType } from 'velite' +``` + +Use `context()` for Velite parser metadata instead of relying on `ZodMeta`. + +## Recommended Upgrade Checklist + +- Update Node.js to `>=20.19.0` in local development and CI. +- Upgrade `velite` to `1.0.0-alpha.2`. +- Replace `ctx.meta` access with `context()`. +- Add `.optional()` to custom schemas that derive missing object fields from the current file. +- Remove `ctx.addIssue({ fatal: false, ... })` warning patterns. +- Switch Next.js projects to `@velite/plugin-next`. +- Run `velite build`, your app build, and your type checks. diff --git a/package.json b/package.json index a6ec6090..9d838d7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "velite", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "description": "Turns Markdown / MDX, YAML, JSON, or other files into app's data layer with type-safe schema.", "keywords": [ "contentlayer", From eddff30afb0427501877ac6e4ddb781f208fe143 Mon Sep 17 00:00:00 2001 From: zce Date: Sat, 16 May 2026 17:46:22 +0800 Subject: [PATCH 14/48] chore: update zod format helpers --- docs/guide/custom-schema.md | 2 +- examples/basic/velite.config.js | 2 +- examples/nextjs/velite.config.ts | 2 +- examples/vite/velite.config.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guide/custom-schema.md b/docs/guide/custom-schema.md index 48545a86..46fbf00e 100644 --- a/docs/guide/custom-schema.md +++ b/docs/guide/custom-schema.md @@ -20,7 +20,7 @@ import { defineSchema, s } from 'velite' export const title = defineSchema(() => s.string().min(1).max(100)) // for validating email -export const email = defineSchema(() => s.string().email({ message: 'Invalid email address' })) +export const email = defineSchema(() => s.email({ message: 'Invalid email address' })) // custom validation logic using refine export const hello = defineSchema(() => s.string().refine(value => value === 'hello', 'Value must be "hello"')) diff --git a/examples/basic/velite.config.js b/examples/basic/velite.config.js index 2a5ea79c..da52821e 100644 --- a/examples/basic/velite.config.js +++ b/examples/basic/velite.config.js @@ -50,7 +50,7 @@ export default defineConfig({ title: s.string().max(99), description: s.string().max(999).optional(), keywords: s.array(s.string()), - author: s.object({ name: s.string(), email: s.string().email(), url: s.string().url() }), + author: s.object({ name: s.string(), email: s.email(), url: s.url() }), links: s.array(s.object({ text: s.string(), link: s.string(), type: s.enum(['navigation', 'footer', 'copyright']) })), socials: s.array(s.object({ name: s.string(), icon, link: s.string().optional(), image: s.image().optional() })) }) diff --git a/examples/nextjs/velite.config.ts b/examples/nextjs/velite.config.ts index d7123505..e4a56e12 100644 --- a/examples/nextjs/velite.config.ts +++ b/examples/nextjs/velite.config.ts @@ -41,7 +41,7 @@ const options = defineCollection({ title: s.string().max(99), description: s.string().max(999).optional(), keywords: s.array(s.string()), - author: s.object({ name: s.string(), email: s.string().email(), url: s.string().url() }), + author: s.object({ name: s.string(), email: s.email(), url: s.url() }), links: s.array(s.object({ text: s.string(), link: s.string(), type: s.enum(['navigation', 'footer', 'copyright']) })), socials: s.array(s.object({ name: s.string(), icon, link: s.string().optional(), image: s.image().optional() })) }) diff --git a/examples/vite/velite.config.ts b/examples/vite/velite.config.ts index d7123505..e4a56e12 100644 --- a/examples/vite/velite.config.ts +++ b/examples/vite/velite.config.ts @@ -41,7 +41,7 @@ const options = defineCollection({ title: s.string().max(99), description: s.string().max(999).optional(), keywords: s.array(s.string()), - author: s.object({ name: s.string(), email: s.string().email(), url: s.string().url() }), + author: s.object({ name: s.string(), email: s.email(), url: s.url() }), links: s.array(s.object({ text: s.string(), link: s.string(), type: s.enum(['navigation', 'footer', 'copyright']) })), socials: s.array(s.object({ name: s.string(), icon, link: s.string().optional(), image: s.image().optional() })) }) From 349bdc182daaa51eb8d42b8df680b98e52f57c58 Mon Sep 17 00:00:00 2001 From: zce Date: Sat, 16 May 2026 17:49:53 +0800 Subject: [PATCH 15/48] chore: update package version --- packages/next/package.json | 2 +- packages/vite/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/package.json b/packages/next/package.json index c0101e9c..4302ba02 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "@velite/plugin-next", - "version": "0.0.1", + "version": "0.1.0-alpha.1", "description": "Next.js plugin for integrating Velite", "type": "module", "exports": "./index.js", diff --git a/packages/vite/package.json b/packages/vite/package.json index e77ecee2..0f76a0e1 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -1,6 +1,6 @@ { "name": "@velite/plugin-vite", - "version": "0.0.2", + "version": "0.1.0-alpha.1", "description": "Vite plugin for integrating Velite", "type": "module", "exports": "./index.js", From b645b91ddcb52a1873bb806361061fe1eca4fa1f Mon Sep 17 00:00:00 2001 From: zce Date: Wed, 17 Jun 2026 19:04:33 +0800 Subject: [PATCH 16/48] feat: enhance schema definitions and improve file handling in build process --- docs/guide/custom-schema.md | 11 +++-- docs/guide/define-collections.md | 22 +++++---- docs/guide/migration.md | 2 +- docs/guide/velite-schemas.md | 6 +-- docs/reference/api.md | 27 ++--------- docs/reference/types.md | 36 ++++---------- src/build.ts | 17 ++++--- src/config.ts | 49 +++++++++++++++++-- src/file.ts | 17 ++++--- src/output.ts | 5 -- src/state.ts | 1 + test/basic.ts | 80 +++++++++++++++++++++++++++++++- 12 files changed, 184 insertions(+), 89 deletions(-) create mode 100644 src/state.ts diff --git a/docs/guide/custom-schema.md b/docs/guide/custom-schema.md index 1a8151be..46ebe963 100644 --- a/docs/guide/custom-schema.md +++ b/docs/guide/custom-schema.md @@ -85,10 +85,13 @@ import { context, defineSchema, s } from 'velite' // convert a nonexistent field export const path = defineSchema(() => - s.custom().transform(value => { - if (value != null) return value - return context().file.path - }) + s + .string() + .optional() + .transform(value => { + if (value != null) return value + return context().file.path + }) ) ``` diff --git a/docs/guide/define-collections.md b/docs/guide/define-collections.md index 98487d6f..a7d5726e 100644 --- a/docs/guide/define-collections.md +++ b/docs/guide/define-collections.md @@ -191,14 +191,20 @@ import { context, s } from 'velite' const posts = defineCollection({ schema: s.object({ - content: s.custom().transform(() => { - const { file } = context() - return file.content - }), - plain: s.custom().transform(() => { - const { file } = context() - return file.plain - }) + content: s + .string() + .optional() + .transform(() => { + const { file } = context() + return file.content + }), + plain: s + .string() + .optional() + .transform(() => { + const { file } = context() + return file.plain + }) }) }) ``` diff --git a/docs/guide/migration.md b/docs/guide/migration.md index 7e451220..22276903 100644 --- a/docs/guide/migration.md +++ b/docs/guide/migration.md @@ -171,7 +171,7 @@ export default withVelite({ `@velite/plugin-vite` supports Vite 5 through Vite 8. Keep the plugin in your Vite config and upgrade Vite normally: ```ts -import { velite } from '@velite/plugin-vite' +import velite from '@velite/plugin-vite' import react from '@vitejs/plugin-react' import { defineConfig } from 'vite' diff --git a/docs/guide/velite-schemas.md b/docs/guide/velite-schemas.md index 9fe35b6a..d5e98ea6 100644 --- a/docs/guide/velite-schemas.md +++ b/docs/guide/velite-schemas.md @@ -124,7 +124,7 @@ allow non-relative path, if true, the value will be returned directly, if false, `string => Image` -image path relative to this file, like `s.file()`, copy file to `config.output.assets` directory and return the [Image](#types) (image object with meta data). +Image path relative to the current file, like `s.file()`. Relative images are copied to `config.output.assets` and returned as [Image](#types) objects. ```ts avatar: s.image() @@ -141,7 +141,7 @@ avatar: s.image() // case 2. non-exists file // 'not-exists.png' => issue 'File not exists' -// case 3. absolute path or full url (if allowed) +// case 3. absolute path or full URL // '/icon.png' => { src: '/icon.png', width: 0, height: 0, blurDataURL: '', blurWidth: 0, blurHeight: 0 } // 'https://zce.me/logo.png' => { src: 'https://zce.me/logo.png', width: 0, height: 0, blurDataURL: '', blurWidth: 0, blurHeight: 0 } ``` @@ -403,7 +403,7 @@ Removes `index` from the path. In addition, all Zod's built-in schemas can be used normally, such as: ```ts -title: s.string().mix(3).max(100) +title: s.string().min(3).max(100) description: s.string().optional() featured: s.boolean().default(false) ``` diff --git a/docs/reference/api.md b/docs/reference/api.md index e5efb25d..7cb822d6 100644 --- a/docs/reference/api.md +++ b/docs/reference/api.md @@ -101,6 +101,11 @@ interface Options { * @default 'info' */ logLevel?: LogLevel + /** + * If true, throws error and terminates process if any schema validation fails. + * @default false + */ + strict?: boolean } ``` @@ -119,22 +124,6 @@ interface Result { } ``` -## `outputFile` - -### Signature - -```ts -const outputFile: async (ref: T, fromPath: string) => Promise -``` - -## `outputImage` - -### Signature - -```ts -const outputImage: async (ref: T, fromPath: string) => Promise -``` - ## `context` Get the current parser context while Velite is parsing a schema. @@ -156,9 +145,3 @@ const context: () => ParserContext - Type: `ParserContext`, See [ParserContext](./types.md#parsercontext). The parser context contains the resolved config and current file. Call `context()` inside schema callbacks such as `.transform()`, `.refine()`, or `.superRefine()`. - -## `cache` - -Deprecated internal implementation detail. Do not use it in user code. - -... diff --git a/docs/reference/types.md b/docs/reference/types.md index 443b429c..82a24d8d 100644 --- a/docs/reference/types.md +++ b/docs/reference/types.md @@ -41,13 +41,6 @@ interface Image { * File loader */ interface Loader { - /** - * Loader name - * @description - * The same name will overwrite the built-in loader, - * built-in loaders: 'json', 'yaml', 'matter' - */ - name: string /** * File test regexp * @example @@ -55,11 +48,10 @@ interface Loader { */ test: RegExp /** - * Load file content + * Load file data from file.value * @param file vfile - * @returns entry or entries */ - load: (file: VFile) => Promisable + load: (file: VFile) => Promisable } ``` @@ -93,9 +85,9 @@ class VeliteFile extends VFile { get plain(): string | undefined /** - * Get meta object from cache + * Get loaded file object from cache * @param path file path - * @returns resolved meta object if exists + * @returns loaded file object if exists */ static get(path: string): VeliteFile | undefined @@ -103,7 +95,7 @@ class VeliteFile extends VFile { * Create file object from file path * @param path file path * @param loaders file loaders - * @returns resolved meta object + * @returns loaded file object */ static async create(path: string, loaders: Loader[]): Promise } @@ -140,19 +132,6 @@ type Context = { Hook callbacks such as `prepare` and `complete` receive this context type. -## Config Cache - -```ts -interface Config { - /** - * @deprecated Internal cache is managed by Velite. This field will be removed in 1.0. - */ - readonly cache: Map -} -``` - -`Config.cache` is kept for compatibility in 0.x. Do not use it in user code. - ## MarkdownOptions ```ts @@ -215,6 +194,11 @@ export interface MdxOptions extends Omit { * @default 'function-body' */ outputFormat?: CompileOptions['outputFormat'] + /** + * Minify the output code. + * @default true + */ + minify?: boolean } ``` diff --git a/src/build.ts b/src/build.ts index 9ff51251..fb90927d 100644 --- a/src/build.ts +++ b/src/build.ts @@ -10,6 +10,7 @@ import { VeliteFile } from './file' import { logger } from './logger' import { outputAssets, outputData, outputEntry } from './output' import { uniqueCache } from './schemas/unique' +import { loadedFiles } from './state' import { matchPatterns } from './utils' import type { LogLevel } from './logger' @@ -19,6 +20,13 @@ import type { Config } from './types' // cache resolved result for rebuild const resolved = new Map() +const clearBuildState = (): void => { + resolved.clear() + loadedFiles.clear() + assets.clear() + uniqueCache.reset() +} + /** * Load file and parse data with given schema * @param config resolved config @@ -173,19 +181,16 @@ const watch = async (config: Config) => { if (configImports.includes(fullpath)) { logger.info('velite config changed, restarting...') watcher.close() - uniqueCache.reset() return build({ config: config.configPath, clean: false, watch: true }) } // skip if filename not match any collection pattern if (!matchPatterns(filename, patterns)) return - // remove changed file from unique cache - uniqueCache.reset(fullpath) - const begin = performance.now() logger.info(`changed: '${fullpath}', rebuilding...`) - await resolve(config, fullpath) + clearBuildState() + await resolve(config) logger.info(`rebuild finished`, begin) } catch (err) { logger.warn(err) @@ -241,7 +246,7 @@ export const build = async (options: Options = {}): Promise => { + const hash = createHash('sha256').update(path).digest('hex').slice(0, 16) + const outdir = join(tmpdir(), 'velite', `config-${hash}`) + await mkdir(outdir, { recursive: true }) + + const modules = await searchFiles(['node_modules'], dirname(path)) + if (modules != null) { + const link = join(outdir, 'node_modules') + try { + await symlink(modules, link, 'dir') + } catch (err) { + if ((err as NodeJS.ErrnoException).code !== 'EEXIST') throw err + let current: string | undefined + try { + current = await readlink(link) + } catch { + current = undefined + } + if (current !== modules) { + await rm(link, { recursive: true, force: true }) + await symlink(modules, link, 'dir') + } + } + } + + return outdir +} + /** * bundle and load user config file * @param path config file path @@ -43,7 +73,7 @@ const loadConfig = async (path: string): Promise<[UserConfig, string[]]> => { throw new Error(`not supported config file with '${ext}' extension`) } - const outfile = join(path, '../node_modules/.velite.config.compiled.mjs') + const outfile = join(await prepareConfigOutdir(path), 'config.mjs') const result = await build({ entryPoints: [path], @@ -54,10 +84,21 @@ const loadConfig = async (path: string): Promise<[UserConfig, string[]]> => { target: 'node18', platform: 'node', metafile: true, + plugins: [ + { + name: 'velite-self-reference', + setup(build) { + build.onResolve({ filter: new RegExp(`^${name}$`) }, () => ({ + path: fileURLToPath(import.meta.resolve(name)), + external: true + })) + } + } + ], packages: 'external' }) - const deps = Object.keys(result.metafile.inputs).map(file => join(path, '..', file)) + const deps = Object.keys(result.metafile.inputs).map(file => resolve(file)) const configUrl = pathToFileURL(outfile) configUrl.searchParams.set('t', Date.now().toString()) // prevent import cache diff --git a/src/file.ts b/src/file.ts index b6a1862e..d91d5527 100644 --- a/src/file.ts +++ b/src/file.ts @@ -5,13 +5,12 @@ import { fromMarkdown } from 'mdast-util-from-markdown' import { toHast } from 'mdast-util-to-hast' import { VFile } from 'vfile' +import { loadedFiles } from './state' + import type { Nodes } from 'hast' import type { Root } from 'mdast' import type { Loader } from './types' -// cache loaded files for rebuild -const loaded = new Map() - export class VeliteFile extends VFile { private _mdast: Root | undefined private _hast: Nodes | undefined @@ -62,18 +61,18 @@ export class VeliteFile extends VFile { } /** - * Get meta object from cache + * Get loaded file object from cache * @param path file path - * @returns resolved meta object if exists + * @returns loaded file object if exists */ static get(path: string): VeliteFile | undefined { - return loaded.get(path) + return loadedFiles.get(path) } /** - * Create meta object from file path + * Create file object from file path * @param options meta options - * @returns resolved meta object + * @returns loaded file object */ static async create(path: string, loaders: Loader[]): Promise { const loader = loaders.find(l => l.test.test(path)) @@ -82,7 +81,7 @@ export class VeliteFile extends VFile { file.value = await readFile(path) file.data = await loader.load(file) if (file.data?.data == null) return file.fail(`no data loaded from '${path}'`) - loaded.set(path, file) + loadedFiles.set(path, file) return file } } diff --git a/src/output.ts b/src/output.ts index 45509f35..2901eb93 100644 --- a/src/output.ts +++ b/src/output.ts @@ -92,13 +92,8 @@ export const outputAssets = async (dest: string, assets: Map): P let count = 0 await Promise.all( Array.from(assets.entries()).map(async ([name, from]) => { - if (emitted.get(name) === from) { - logger.log(`skipped copy '${name}' with same content`) - return - } await copyFile(from, join(dest, name)) // logger.log(`copied '${name}' from '${from}'`) - emitted.set(name, from) count++ }) ) diff --git a/src/state.ts b/src/state.ts new file mode 100644 index 00000000..8afe582d --- /dev/null +++ b/src/state.ts @@ -0,0 +1 @@ +export const loadedFiles = new Map() diff --git a/test/basic.ts b/test/basic.ts index 0d43d5e3..eb4ab0c5 100644 --- a/test/basic.ts +++ b/test/basic.ts @@ -1,6 +1,8 @@ import { equal } from 'node:assert' import { exec } from 'node:child_process' -import { readFile, rm } from 'node:fs/promises' +import { access, mkdir, mkdtemp, readdir, readFile, rm, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' import { test } from 'node:test' test('standalone fixtures', async t => { @@ -39,3 +41,79 @@ test('consecutive builds do not reuse unique values from previous builds', async await rm('examples/basic/.velite', { recursive: true, force: true }) }) + +test('builds do not reuse assets from previous configs', async () => { + const { build } = await import('velite') + const root = await mkdtemp(join(tmpdir(), 'velite-assets-')) + + await mkdir(join(root, 'content')) + await writeFile(join(root, 'content', 'item.json'), JSON.stringify({ title: 'Hello' })) + await writeFile( + join(root, 'velite.config.mjs'), + `import { defineConfig, s } from 'velite' + +export default defineConfig({ + root: 'content', + output: { data: '.velite', assets: 'public/static', clean: true }, + collections: { + items: { + name: 'Item', + pattern: 'item.json', + schema: s.object({ title: s.string() }) + } + } +}) +` + ) + + try { + await build({ config: 'examples/basic/velite.config.js' }) + await build({ config: join(root, 'velite.config.mjs') }) + + const assets = await readdir(join(root, 'public/static')) + equal(assets.length, 0, 'asset output should not include assets from a previous config') + } finally { + await rm('examples/basic/.velite', { recursive: true, force: true }) + await rm(root, { recursive: true, force: true }) + } +}) + +test('builds do not reuse emitted assets from previous output directories', async () => { + const { build } = await import('velite') + const root = await mkdtemp(join(tmpdir(), 'velite-emitted-')) + + await mkdir(join(root, 'content')) + await writeFile(join(root, 'content', 'asset.txt'), 'asset') + await writeFile(join(root, 'content', 'item.json'), JSON.stringify({ title: 'Hello', file: 'asset.txt' })) + + const config = (assets: string) => + [ + "import { defineConfig, s } from 'velite'", + '', + 'export default defineConfig({', + " root: 'content',", + ` output: { data: '.velite-${assets}', assets: 'public/${assets}', clean: true, name: '[name].[ext]' },`, + ' collections: {', + ' items: {', + " name: 'Item',", + " pattern: 'item.json',", + ' schema: s.object({ title: s.string(), file: s.file() })', + ' }', + ' }', + '})', + '' + ].join('\n') + + await writeFile(join(root, 'velite.a.mjs'), config('a')) + await writeFile(join(root, 'velite.b.mjs'), config('b')) + + try { + await build({ config: join(root, 'velite.a.mjs') }) + await build({ config: join(root, 'velite.b.mjs') }) + + await access(join(root, 'public/a/asset.txt')) + await access(join(root, 'public/b/asset.txt')) + } finally { + await rm(root, { recursive: true, force: true }) + } +}) From 7a17fd5fdc074dc1fb7a8326b83ca184fd467335 Mon Sep 17 00:00:00 2001 From: zce Date: Wed, 17 Jun 2026 19:47:33 +0800 Subject: [PATCH 17/48] feat: add initial documentation for AI workspace and session management --- .agents/AGENTS.md | 54 +++++++++++++++++ .agents/knowledge/.gitkeep | 0 .agents/sessions/.gitignore | 6 ++ .agents/sessions/AGENTS.md | 114 ++++++++++++++++++++++++++++++++++++ AGENTS.md | 96 ++++++++++++++++++++++++++++++ packages/AGENTS.md | 23 ++++++++ 6 files changed, 293 insertions(+) create mode 100644 .agents/AGENTS.md create mode 100644 .agents/knowledge/.gitkeep create mode 100644 .agents/sessions/.gitignore create mode 100644 .agents/sessions/AGENTS.md create mode 100644 AGENTS.md create mode 100644 packages/AGENTS.md diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md new file mode 100644 index 00000000..087efd6f --- /dev/null +++ b/.agents/AGENTS.md @@ -0,0 +1,54 @@ +# `.agents/` — AI Workspace + +This directory is the central hub for AI-related artefacts for this repository. It is **not** part of the shipped codebase. + +## Two directories, two purposes + +| Directory | Purpose | Lifetime | Tracked in git? | +| ------------ | ---------------------------------------------------------- | ------------------ | ------------------- | +| `knowledge/` | Stable conventions every session (human + AI) must follow | Long-lived, edited | **Yes** | +| `sessions/` | Transient session artefacts: plans, scratch notes, reports | Per-session | **No** (gitignored) | + +If a finding is universal and reusable → it belongs in `knowledge/`. +If it is "what we did this session" or "where we are right now" → it belongs in `sessions/`. + +## Layout + +``` +.agents/ +├── AGENTS.md ← this file +├── knowledge/ ← stable, long-lived AI conventions (tracked) +│ └── ... +└── sessions/ ← transient per-session scratch (gitignored) + ├── .gitignore ← ignores session subfolders, tracks AGENTS.md + ├── AGENTS.md ← session folder rules & naming + └── YYYYMMDD-HHmm-{slug}/ ← one folder per session + ├── plan.md + ├── notes.md + ├── report.md + └── ... +``` + +## Git policy + +- `knowledge/` is **tracked** — commit conventions here like any other source file. +- `sessions/.gitignore` ignores all session subfolders (`*/`). To commit a session on a feature branch for review context, add an un-ignore line (e.g. `!20260617-1430-schema-refactor`). Remove it before merging to `main`. +- Session folders must **never** be merged into `main`. Promote durable findings to `knowledge/` before cleanup. + +## When to create a session + +**Create a new session** when the user starts a new, unrelated task or a previous session is finished. + +**Reuse the existing session** when the user says "continue", "keep going", or the work spans multiple conversations on the same task. + +When unsure, list recent sessions (`ls -1t sessions/`) and ask. + +## Knowledge directory + +`knowledge/` holds conventions discovered during development that future sessions should follow. Examples: + +- Naming conventions specific to this repo +- Non-obvious build or test patterns +- Decisions with rationale that aren't obvious from the code + +Each file should be short, factual, and named by topic (e.g. `schema-patterns.md`, `testing-notes.md`). diff --git a/.agents/knowledge/.gitkeep b/.agents/knowledge/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/.agents/sessions/.gitignore b/.agents/sessions/.gitignore new file mode 100644 index 00000000..d6b2b0b7 --- /dev/null +++ b/.agents/sessions/.gitignore @@ -0,0 +1,6 @@ +# AI Agents sessions — only AGENTS.md is committed; session subfolders are ignored +*/ + +# You can temporarily include the current session directory in your branch for a better DX +# Remove this before merging, or it will cause noise in master +# e.g. `!20260427-1200-schema-refactor` diff --git a/.agents/sessions/AGENTS.md b/.agents/sessions/AGENTS.md new file mode 100644 index 00000000..03394145 --- /dev/null +++ b/.agents/sessions/AGENTS.md @@ -0,0 +1,114 @@ +# `.agents/sessions/` — AI Session Workspace + +Transient scratch space for AI-assisted sessions: plans, research notes, status reports, and any artefact that helps a human or a future AI session pick up where the previous one left off. + +**Not** part of the codebase. **Not** for source code. + +--- + +## Git policy + +`sessions/.gitignore` ignores all session subfolders by default — only `sessions/AGENTS.md` is tracked. Session subfolders are ignored so casual `git add .` never sweeps them up. + +### Opting a session into a feature branch (recommended) + +Session artefacts are valuable review context. To commit a session folder on a feature branch, add an un-ignore line to `sessions/.gitignore`: + +``` +!20260617-1430-schema-refactor +``` + +### Hard rule: do NOT merge session content into main + +Before merging: + +1. Remove the `!` un-ignore line from `sessions/.gitignore`. +2. `git rm -r --cached .agents/sessions//` to drop from index. +3. Commit the cleanup, then merge. + +If a session artefact has long-term value, **promote it** to `../knowledge/` (or another appropriate location) before the cleanup commit. + +--- + +## Layout + +``` +.agents/sessions/ +├── .gitignore ← this file: ignores session subfolders +├── AGENTS.md ← session folder rules & naming (this file) +└── YYYYMMDD-HHmm-{slug}/ ← one folder per session (gitignored) + ├── plan.md + ├── notes.md + ├── report.md + └── ... +``` + +--- + +## Session folder naming + +Format: `YYYYMMDD-HHmm-{slug}` + +- `YYYYMMDD-HHmm` — local time when the session started. +- `{slug}` — short, lowercase, kebab-case description of the task. 2-5 words. +- Examples: + - `20260617-1430-schema-refactor` + - `20260617-1500-fix-asset-dedup` + - `20260618-0900-doc-cleanup` + +If two sessions collide on the same minute, append `-2`, `-3`, etc. to the slug. + +--- + +## When to create a new session vs. reuse an existing one + +**Create a new session** when: + +- The user starts a new, unrelated task. +- A previous session is finished (`report.md` written) and a follow-up has a different goal. + +**Reuse the existing session** when: + +- The user says "continue", "keep going", "next step", or references the previous task. +- The work is the same task spread across multiple conversations. +- An open `todo.md` or `plan.md` still has unfinished items relevant to the new turn. + +When unsure, list the most recent session folders (`ls -1t .agents/sessions/`) and ask the user which to resume, or default to the most recent if it clearly matches. + +--- + +## Files inside a session + +All optional. Only create what the task actually needs. + +| File | Purpose | +| ------------ | --------------------------------------------------------------- | +| `plan.md` | Goal, constraints, ordered steps, decisions still to make | +| `notes.md` | Findings, snippets, code references (`file:line`), observations | +| `report.md` | Final summary when the task ends — what shipped, what didn't | +| `todo.md` | Outstanding actionable items, with owner if known | +| `context.md` | Background a future session must know to make sense of the work | +| `logs.md` | Verbatim command output / tool runs only when materially useful | + +--- + +## Writing rules + +1. Markdown only. No binaries, no screenshots unless the user provides them. +2. Bullet points and tables over prose. Aim for skimmable. +3. Reference source code with `path/to/file.ts:lineNumber`, never paste large source blocks. +4. Record decisions **and the reasoning** — future you will not remember why. +5. English only, matching the rest of the repo. +6. No secrets, tokens, passwords, or anything unsafe in a public gist. +7. Treat every session folder as ephemeral. If something must survive, promote it. + +--- + +## Quality bar + +A reviewer opening a session folder cold should, within ~2 minutes, answer: + +- What was the goal? +- What is the current state? +- What changed in the actual codebase? +- What, if anything, is still pending? diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..6f7a839f --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,96 @@ +# AGENTS.md + +Velite — a tool that turns Markdown / MDX, YAML, JSON into a type-safe data layer using Zod schemas. + +## Quick reference + +| What | Command | +| --------------------------- | --------------- | +| Install deps | `pnpm install` | +| Build (type-check + bundle) | `pnpm build` | +| Run tests | `pnpm test` | +| Format code | `pnpm format` | +| Dev docs site | `pnpm docs:dev` | + +**Required order for verification:** `pnpm build` → `pnpm test` (tests run against built `dist/`). + +## Architecture + +- **Monorepo** managed by pnpm workspaces: root package, `docs/`, `examples/*`, `packages/*` +- Root package is the core library (`velite` on npm) +- `packages/next` → `@velite/plugin-next` (Next.js integration, hand-written JS) +- `packages/vite` → `@velite/plugin-vite` (Vite integration, hand-written JS) +- ESM-only (`"type": "module"`), Node.js >=20.19.0 + +## Source layout (`src/`) + +| File | Role | +| ------------ | ----------------------------------------------------------------------------------------------------------------------------------- | +| `index.ts` | Public API barrel export | +| `cli.ts` | CLI entry (`velite build` / `velite dev`) | +| `build.ts` | Core build orchestration, watch mode | +| `config.ts` | Config resolution (bundles user config via esbuild) | +| `context.ts` | Schema parsing with Zod context | +| `file.ts` | `VeliteFile` — file loading and record extraction | +| `output.ts` | Data/asset output, `.d.ts` generation | +| `assets.ts` | Asset tracking and deduplication | +| `state.ts` | Global build state | +| `logger.ts` | Logging with levels | +| `types.ts` | All TypeScript interfaces (`Config`, `UserConfig`, `Collection`, etc.) | +| `utils.ts` | Pattern matching utilities | +| `loaders/` | Built-in loaders: `json`, `yaml`, `matter` (frontmatter) | +| `schemas/` | Custom Zod extensions: `file`, `image`, `markdown`, `mdx`, `slug`, `toc`, `excerpt`, `metadata`, `path`, `raw`, `isodate`, `unique` | + +## Key patterns + +- `s` is the extended Zod namespace (`src/schemas/index.ts:16`) — re-exports all of `zod` plus custom schemas +- User config files (`velite.config.{js,ts,mjs,mts,cjs,cts}`) are bundled with esbuild at runtime, not imported directly (`src/config.ts:69`) +- Config is searched up to 3 parent directories from cwd (`src/config.ts:21`) +- Default content root: `content/`, default output: `.velite/` (data) + `public/static/` (assets) +- `defineConfig`, `defineCollection`, `defineLoader`, `defineSchema` are identity helpers for type inference only +- The `prepare` hook can return `false` to suppress default file output +- Tests use Node's built-in test runner (`node:test`), not Jest/Vitest + +## Code style + +- Prettier: no semicolons, single quotes, no trailing commas, 160 char width +- Import sorting via `@ianvs/prettier-plugin-sort-imports` (configured in `prettier.config.js`) +- Pre-commit hook: `simple-git-hooks` → `lint-staged` → `prettier --write` + +## Testing + +```bash +pnpm test # runs: node --import tsx --test test/*.ts +``` + +- Tests in `test/` use `node:test` + `node:assert` +- Tests run against the **built** output (`dist/`), so `pnpm build` must run first +- `test/basic.ts` builds the `examples/basic` fixture and checks output file sizes +- Tests clean up `.velite` output dirs after running + +## Gotchas + +- `bin/velite.js` imports `../dist/cli.js` — you must build before running the CLI from source +- The `tsup` config injects a `require` shim banner for CJS interop in the ESM output +- `sharp` and `esbuild` are allowed native builds in `pnpm-workspace.yaml` +- Config bundling uses `packages: 'external'` — user deps are not bundled into config output +- The `unique` schema (`src/schemas/unique.ts`) uses a global cache that must be reset between builds (`clearBuildState` in `build.ts:23`) + +## Session workspace + +- **Plans, intermediate notes, per-task reports** go under `.agents/sessions/YYYYMMDD-HHmm-{slug}/`. +- **Save plans to:** `.agents/sessions/YYYYMMDD-HHmm-{slug}/plan.md` instead of the plugin or skill presets. +- **Save specs to:** `.agents/sessions/YYYYMMDD-HHmm-{slug}/specs.md` instead of the plugin or skill presets. +- Session subfolders are gitignored by default — never put long-lived conventions there; promote them to `.agents/knowledge/` instead. +- Full rules: `.agents/AGENTS.md` + +## Subdirectory AGENTS.md + +Load a subdirectory's `AGENTS.md` when you are about to work primarily in that directory: + +| When working in | Load | +| ----------------------------------------- | -------------------- | +| `packages/next` or `packages/vite` | `packages/AGENTS.md` | +| Planning, research, or session management | `.agents/AGENTS.md` | + +Skip if you are only passing through (e.g. a quick grep or single-file read). diff --git a/packages/AGENTS.md b/packages/AGENTS.md new file mode 100644 index 00000000..29e3e1bc --- /dev/null +++ b/packages/AGENTS.md @@ -0,0 +1,23 @@ +# `packages/` — Framework Plugins + +Two integration packages, both hand-written JavaScript (no build step): + +| Package | npm name | What it does | +| ---------------- | --------------------- | ---------------------------------------------- | +| `packages/next/` | `@velite/plugin-next` | Next.js config plugin (dev watch + prod build) | +| `packages/vite/` | `@velite/plugin-vite` | Vite plugin (dev watch + prod build) | + +## Key facts + +- **Plain JS** — no TypeScript, no build step. Ship `index.js` + `index.d.ts` directly. +- Both import `velite` as a workspace dependency (`"velite": "workspace:*"`). +- Both call `build()` from the core library; the Next.js plugin also supports `watch` mode. +- `.d.ts` files are hand-written type declarations, not generated. +- `node_modules/` inside each package is a symlink created by pnpm (for the workspace peer dep resolution) — ignore it. + +## When editing + +- Keep the JS minimal and framework-version-agnostic. +- Update `index.d.ts` in sync with any API changes to `index.js`. +- Bump `peerDependencies` ranges when a new framework major is supported. +- These packages have no tests of their own — verify via the root `pnpm test` (which exercises the examples). From 29dbb0ca5a170e2161d61e7c02a954f9788b5a77 Mon Sep 17 00:00:00 2001 From: zce Date: Wed, 17 Jun 2026 20:46:15 +0800 Subject: [PATCH 18/48] feat: Add core architecture design and specs review documents - Introduced core architecture design document for Velite 1.0, outlining goals, non-goals, design principles, proposed module layout, and migration plan. - Added detailed specs review documents (Rounds 4 to 6) to track review progress and resolutions, ensuring clarity and consistency in the architecture. - Included acceptance criteria and open follow-up items to guide future development phases. --- .agents/sessions/.gitignore | 2 + .../20260617-0000-core-architecture/specs.md | 422 ++++++++++++++++++ 2 files changed, 424 insertions(+) create mode 100644 .agents/sessions/20260617-0000-core-architecture/specs.md diff --git a/.agents/sessions/.gitignore b/.agents/sessions/.gitignore index d6b2b0b7..5d9a68ba 100644 --- a/.agents/sessions/.gitignore +++ b/.agents/sessions/.gitignore @@ -4,3 +4,5 @@ # You can temporarily include the current session directory in your branch for a better DX # Remove this before merging, or it will cause noise in master # e.g. `!20260427-1200-schema-refactor` + +!20260617-0000-core-architecture/ diff --git a/.agents/sessions/20260617-0000-core-architecture/specs.md b/.agents/sessions/20260617-0000-core-architecture/specs.md new file mode 100644 index 00000000..25d47775 --- /dev/null +++ b/.agents/sessions/20260617-0000-core-architecture/specs.md @@ -0,0 +1,422 @@ +# Core Architecture Design + +## Status + +Draft approved for planning. This document defines the desired internal architecture for Velite 1.0 core refactoring. + +## Context + +Velite started as a small content build utility. The current implementation still works, but the core build flow has outgrown its original script-like structure. Several responsibilities are currently coupled inside `src/build.ts`, and mutable build state is distributed across module-level globals such as loaded files, resolved collections, assets, emitted output cache, and unique value cache. + +This makes the system harder to reason about and hard to unit test. Many tests must run real fixture builds through the package entry instead of testing isolated behavior. Watch mode is especially sensitive because partial rebuild state can become stale when assets, loaded files, config dependencies, or output caches are reused incorrectly. + +The goal of this design is to introduce clear internal architecture boundaries before 1.0 without over-committing to advanced public plugin APIs. + +## Goals + +- Refactor Velite's core from a script-like build flow into a clear build engine. +- Give each build an isolated `BuildSession` that owns state and caches. +- Organize the core flow as pipeline-shaped internal stages: config, discover, load, parse, asset collection, output, hooks, and watch. +- Make core modules unit-testable without always running full fixture builds. +- Keep the public API stable where practical: `build()`, `defineConfig()`, schemas, and config hooks. +- Keep room for future pipeline/plugin extension points without exposing them prematurely. + +## Non-Goals + +- Do not expose a full stage-based plugin API in 1.0. +- Do not introduce heavy abstractions such as a dependency injection container or event bus. +- Do not rewrite every schema, loader, and output detail at once. +- Do not optimize watch mode for fine-grained incremental rebuilds before state ownership is correct. +- Do not export `src/core/*` as public API. + +## Design Principle + +Use approach B as the architecture and approach C as the internal shape: + +- Build a clear internal core architecture first. +- Shape the internals like a pipeline so future extension points can wrap existing stages. +- Keep public extension APIs conservative for 1.0 because current config hooks are enough for short-term needs. + +## Proposed Module Layout + +```text +src/ + build.ts public build() facade + core/ + engine.ts BuildEngine orchestration + session.ts BuildSession and state/cache lifecycle + config.ts ConfigLoader and temporary config bundle lifecycle + discover.ts content file discovery + load.ts VeliteFile loading + parse.ts schema parsing with ParserContext + assets.ts AssetStore and session-owned asset collection + output.ts OutputWriter + watch.ts WatchController +``` + +### Public Facade + +`src/build.ts` should become a thin public facade. It receives `Options`, creates or delegates to the core engine, and returns the build result. It should not directly own caches, asset state, file discovery, parsing, output writing, or watch orchestration. + +### Core Modules + +`src/core/*` is internal. It must not be exported directly from `src/index.ts`. If a stable public type is needed, expose it through `src/types.ts` instead of exporting internal modules. + +This avoids accidental public APIs such as internal cache clearing helpers. + +`ConfigLoader` owns the lifecycle of temporary config bundles created by esbuild. It should decide where compiled config files live, how dependency resolution works from that location, and when stale temporary files or symlinks are replaced. User config compilation must not write into user `node_modules`. + +When the same `ConfigLoader` is used across watch reloads in a long-running engine, it should replace the previous temporary bundle in place rather than accumulating one bundle per reload. + +`core/assets.ts` should contain the session-owned `AssetStore` and asset collection logic. The current `src/assets.ts` mixes public utility helpers, metadata helpers, unified plugins, and global asset state. During migration, keep public helpers such as `isRelativePath()` and `getImageMetadata()` available from the public entry, and move only session-owned asset state/collection into core. Unified plugin factories can stay outside core if they accept an explicit `AssetStore` when constructed. + +## Build Data Flow + +One build should follow a clear data flow: + +```text +build(options) + -> ConfigLoader.load(options) + -> BuildSession.create(config, options) + -> OutputWriter.writeEntry(session) + -> ContentResolver.resolve(session) + -> OutputWriter.writeDataAndAssets(session, resolved) + -> run complete hook + -> optionally WatchController.start(engine, config) + -> return result +``` + +The internal engine should expose a small contract: + +```ts +type BuildEngine = { + build(options: Options): Promise + rebuild(): Promise + readonly config: Config | undefined +} +``` + +`Result` is the current public build result shape, equivalent to `Record`. Do not widen the public `build()` return value in this refactor. + +`rebuild()` creates a fresh `BuildSession` from the engine's current resolved config. It does not reload config, does not honor `output.clean`, and does not rerun `OutputWriter.writeEntry()`. It still ensures output directories exist before writing. Config reload and entry regeneration belong to the watch branch that handles config dependency changes. + +The engine should expose its current resolved config internally as `engine.config` after `build()` completes so `WatchController` can re-arm itself with updated `configImports` and collection patterns after a config dependency reload. This must not change the public `build()` return value. + +Expanded flow: + +```text +Options + -> ConfigLoader + -> ResolvedConfig + -> BuildSession + -> OutputWriter writes entry and d.ts from config collections + -> Discover collection file paths + -> Load VeliteFile objects + -> Parse records with ParserContext + -> Build Result and file messages + -> Prepare hook + -> OutputWriter writes JSON data and assets + -> Complete hook +``` + +`OutputWriter.writeEntry()` may run before content resolution because entry files and type declarations depend on the resolved config and collection schemas, not on parsed content results. Content changes in watch mode do not need to rewrite entry files; config dependency changes reload config and start a fresh build, which rewrites entry files. + +## Parser Context + +`ParserContext` should expose only the capabilities schema callbacks need. It should not expose the whole session. + +Proposed shape: + +```ts +type ParserContext = { + config: Config + file: VeliteFile + assets: AssetStore + unique: UniqueStore +} +``` + +Schemas such as `s.file()` and `s.image()` should collect assets through `context().assets.add(...)` rather than writing to a module-level asset map. + +Schemas such as `s.unique()` should use `context().unique` rather than a module-level unique cache. This keeps unique value state inside the current session. + +Markdown and MDX linked-file copying currently runs inside remark/rehype plugins created by the markdown/mdx schemas. Those plugins should receive `AssetStore` explicitly when they are constructed, instead of relying on a module-level asset map. `AsyncLocalStorage` usually propagates through promise chains, but explicit injection is clearer and avoids hidden assumptions if unified internals change. + +Existing public `context()` behavior should remain stable for user code. New fields should be added carefully and documented only if they are meant to be public. + +## Hook Context + +Existing config hooks should remain conservative: + +```ts +prepare(result, { config }) +complete(result, { config }) +``` + +The core may use a richer internal session, but `HookContext` should not automatically expose session internals. This keeps the 1.0 public API smaller and easier to maintain. + +## BuildSession State Model + +All build-scoped mutable state should belong to `BuildSession`. + +```ts +type BuildSession = { + config: Config + options: Options + files: FileCache + resolved: CollectionCache + assets: AssetStore + unique: UniqueStore + output: OutputState +} +``` + +`options` stored on the session is the resolved options object after defaults have been applied, not the raw user input. This avoids duplicate defaulting logic across engine and session code. + +If a session identifier becomes useful for logs or debug traces, add it later as an internal optional field. It is not required for the core state model. + +Rules: + +- A normal `build()` creates a fresh session. +- Sessions are not reused across independent builds. +- Module-level mutable build state should be eliminated. +- Utility functions, schema factories, and public facades can remain module-level if they are stateless. +- `AsyncLocalStorage` may continue to hold the current parser context during parsing, but the context should point at current session-owned capabilities. + +`VeliteFile` should no longer own a static global file cache. File caching should move to a session-owned file cache, for example: + +```ts +type FileCache = { + get(path: string): VeliteFile | undefined + load(path: string, loaders: Loader[]): Promise +} +``` + +The preferred migration path is `session.files.load(path, loaders)` and `session.files.get(path)` rather than adding cache parameters to `VeliteFile.create()` or using another `AsyncLocalStorage` lookup. `VeliteFile` should remain the loaded file data object, not the cache manager. + +## AssetStore + +`AssetStore` should represent assets collected during the current session. + +Future-friendly asset records should include source ownership: + +```ts +type AssetRecord = { + sourcePath: string + outputName: string + publicUrl: string + ownerFiles: Set +} + +type AssetStore = { + add(record: { sourcePath: string; outputName: string; publicUrl: string; ownerFile: string }): AssetRecord + list(): AssetRecord[] + byOwner(file: string): AssetRecord[] +} +``` + +`outputName` is the rendered output filename, such as `cover-a1b2c3d4.png`. It should be the asset output key. `sourcePath` is the original absolute file path. `publicUrl` is the final URL exposed in parsed content. `ownerFiles` records every content file that caused this asset to be collected. + +`AssetStore.add()` should be idempotent for the same `outputName` and `sourcePath`, merging `ownerFile` into `ownerFiles`. The same `outputName` with a different `sourcePath` should be treated as a hard error because it indicates a hash collision or an unsafe filename template. + +This allows future incremental watch mode to remove assets owned by a changed file while keeping assets still owned by other files. The 1.0 implementation does not need fine-grained incremental asset updates, but it should avoid designs that make them impossible. + +## UniqueStore + +The unique value cache should become session-owned: + +```ts +type UniqueStore = { + register(group: string, value: string, file: string): string | undefined +} +``` + +`group` matches the current `s.unique(group)` namespace. It is not necessarily a collection name. `register()` returns the conflicting file path when the value already exists, or `undefined` after registering a new value. This preserves the existing duplicate error message that includes the conflicting path. + +Independent builds should not need global reset calls. Watch mode can create a fresh session per rebuild until a proper dependency graph exists; see Open Follow-Up: incremental rebuilds. + +## Diagnostics + +Do not introduce a separate `Diagnostics` store in the first refactor unless it has clear producers and consumers. Current diagnostics live on `VeliteFile` as vfile messages and are reported by the resolver. The initial core split should keep that behavior: parser and loader issues attach to files, and `ContentResolver` derives reports from resolved files. A dedicated diagnostics object can be introduced later if hooks or tooling need a structured diagnostic API. + +## OutputState + +Data output caching can be session-owned or watch-owned. Independent `build()` calls must not reuse a previous call's data emit cache, because a user may delete the output directory between builds. Watch mode may keep output cache in watch state, but it must not affect fresh non-watch builds. + +Minimal shape: + +```ts +type OutputState = { + emitted: Map +} +``` + +`emitted` is keyed by output path and stores the last written content for data/entry skip-if-same behavior. Asset output does not belong in this cache in the initial design; assets should be copied from the current `AssetStore`, or later cached by target path plus content hash/mtime if needed. + +Asset output should not use an incomplete cache keyed only by asset name and source path. + +Safer options: + +- Always copy assets from the current `AssetStore`. +- Or cache by target path and content hash/mtime if performance becomes important. + +Data file output can keep content-based skipping because the target path and content are known. + +## Watch Strategy + +For 1.0, watch mode should prefer correctness over fine-grained incremental performance. + +```text +watch event + -> if config dependency changed: + close watcher + call the config-reload path + re-arm watcher with new resolved config + -> if content changed: + create new BuildSession + full resolve + output current result/assets +``` + +`WatchController` responsibilities: + +- Create and close chokidar watchers. +- Classify events. +- Detect config dependency changes. +- Trigger `engine.rebuild()` on content changes and the config-reload path on config dependency changes. +- Avoid direct cache mutation, parsing, or output writing. + +`WatchController` should not hold a `BuildSession`. It holds the engine and current config. On each content change it calls `engine.rebuild()` to create a fresh session. The old session is no longer referenced and can be garbage-collected. + +The config-reload path should call internal `engine.build({ ...options, clean: false })` rather than recursing through the public `build()` facade. Watch reloads must explicitly pass `clean: false`; the engine itself does not track whether `clean` has already been honored. The watch controller then reads `engine.config` and re-arms itself with the new `configImports` and collection patterns. + +Fine-grained incremental rebuilds should be a later optimization based on explicit data structures such as `AssetStore.ownerFiles` and a dependency graph. + +This is an intentional performance trade-off. The current implementation has a `changed` path that can skip some unchanged files. The first core watch redesign may move single-file changes from roughly changed-file work toward full-project work. That trade-off is acceptable for 1.0 correctness, but it should be measured on larger content projects before release if watch performance is a concern. + +## Testing Strategy + +Testing should use three layers. + +### Unit Tests + +Core modules should be testable with fake dependencies: + +- `ConfigLoader` +- `AssetStore` +- `ContentResolver` +- `OutputWriter` +- `BuildSession` + +Use selective dependency injection rather than full virtualization. Only modules that perform direct IO should accept dependency objects. `OutputWriter` should accept filesystem dependencies, and `Discover` should accept glob dependencies. Other modules should prefer direct values or synthetic inputs in tests. + +Example dependency shape: + +```ts +type CoreDeps = { + fs: FileSystem + glob: Glob + logger: Logger +} +``` + +Default dependencies use real implementations. Unit tests pass hand-written fakes where needed. Use the repository's existing `node:test` stack rather than adding a new test framework just for core unit tests. + +Logger should become session-scoped for core execution. The public facade may keep a module-level logger export for compatibility, but core modules should receive the session logger through dependencies or session context instead of mutating a process-level singleton during builds. This avoids log-level races between concurrent builds and makes log output testable. + +### Integration Tests + +Keep real fixture tests for: + +- basic project +- Next.js project +- Vite project + +These verify package entry behavior and real application integration. + +### Regression Tests + +Keep or add focused tests for known architectural failure modes: + +- Consecutive builds do not reuse unique values. +- Consecutive builds do not reuse assets. +- Consecutive builds do not skip asset copies due to cross-build state. +- Config compilation does not write to user `node_modules`. +- Config dependencies resolve to correct absolute paths. +- Calling `build()` twice with the data output directory deleted between calls produces all expected JSON files on the second call. +- Watch content changes do not output stale assets. +- Watch config dependency changes reload config. + +## Migration Plan + +### Phase 1: Create Core Skeleton Without Behavior Changes + +- Create `src/core/`. +- Add initial core modules listed in the layout that are needed at this stage: `session.ts`, `engine.ts`, `assets.ts`, `output.ts`, `config.ts`. Defer `discover.ts`, `load.ts`, and `parse.ts` to Phase 3, and `watch.ts` to Phase 4. +- Keep `build.ts` as the public facade. +- Move existing logic behind the facade without intentionally changing behavior. +- Keep existing tests passing. +- Keep `ConfigLoader` responsible for temporary config bundle paths, dependency resolution from the temp location, and stale temp symlink replacement. + +### Phase 2: Move Mutable Build State Into BuildSession + +- Move assets into `BuildSession.assets`. +- Move loaded files into `BuildSession.files`. +- Move unique cache into `BuildSession.unique`. +- Move resolved collections into `BuildSession.resolved`. +- Move output state into session or watch state. +- Replace `VeliteFile.get/create` cache ownership with `session.files.get/load`. +- Wire session-owned `assets` and `unique` into the existing parser context as part of this phase. Do not leave an intermediate state where schemas still rely on module-level globals. +- Remove module-level mutable build state. + +### Phase 3: Split Resolver, Parser, and Output Writer + +- Split current resolve logic into discovery, load, parse, file-message reporting, and result assembly. +- Make `OutputWriter` responsible only for entry, type declarations, JSON data, and assets. +- Adjust schemas (`s.file()`, `s.image()`, `s.unique()`, markdown/mdx) to consume the parser-context capabilities introduced in Phase 2 instead of direct globals. +- Pass `AssetStore` explicitly into remark/rehype linked-file plugins when markdown/mdx schemas construct them. +- Construct a session-scoped logger and pass it through core dependencies or session context. Keep any public logger facade as compatibility glue, not as core build state. + +### Phase 4: Rebuild Watch Around Correctness + +- Introduce `WatchController`. +- Reload config on config dependency changes. +- Use a new session and full resolve on content changes. +- Do not let `WatchController` retain build sessions across content-change events. +- Add watch regression tests. + +### Phase 5: Add Unit Test Coverage + +- Add unit tests for config loading, asset store, output writer, content resolver, and session lifecycle. +- Keep fixture tests as integration tests. + +### Phase 6: Optional Incremental Optimization + +- Add source ownership and dependency graph based incremental rebuilds only if watch performance becomes a proven problem. +- Do not make this a required 1.0 milestone. + +## Compatibility Strategy + +- Keep `build(options)` stable. +- Keep `defineConfig`, `defineCollection`, and `defineSchema` stable. +- Keep schema public APIs stable where practical. +- Keep `prepare` and `complete` config hooks stable. +- Do not export `src/core/*`. +- Do not expose a stage-based plugin API in 1.0. +- Document core architecture in contributor-facing docs only, not public API reference. + +## Acceptance Criteria + +- Build-related mutable state is no longer stored in module-level globals. +- Independent builds are isolated by construction, not by manual global reset calls. +- `AssetStore.add()` rejects two records with the same `outputName` and different `sourcePath`. +- `ContentResolver` can be unit-tested with fake file data and fake loaders. +- `OutputWriter` can be unit-tested without running a full fixture project. +- Watch config changes and content changes have regression coverage. +- Calling `build()` twice with the data output directory deleted between calls produces all expected JSON files on the second call. +- Existing `pnpm build`, `pnpm test`, and `pnpm docs:build` pass. +- No internal core module is accidentally exported as public API. + +## Open Follow-Up + +Watch mode intentionally starts with full rebuilds for correctness. This may regress single-file watch rebuild performance from changed-file work toward full-project work. If performance becomes an issue, introduce incremental rebuilds later using explicit ownership and dependency graph data structures. From 67b2ae1489373899ada045fbb203c7f4ef85d1d9 Mon Sep 17 00:00:00 2001 From: Lei Date: Fri, 19 Jun 2026 14:59:54 +0800 Subject: [PATCH 19/48] Refactor core architecture (#385) --- .agents/sessions/.gitignore | 2 + .../architecture-review-02.md | 161 + .../architecture-review.md | 237 + .../20260617-0000-core-architecture/plan.md | 76 + .../20260617-0000-core-architecture/report.md | 91 + .../20260617-0000-core-architecture/specs.md | 445 + .github/workflows/docs.yml | 34 +- .github/workflows/main.yml | 25 +- .github/workflows/publish.yml | 62 +- .vscode/settings.json | 3 +- AGENTS.md | 47 +- bin/velite.js | 3 - docs/guide/define-collections.md | 12 +- docs/guide/migration.md | 23 +- docs/guide/quick-start.md | 2 +- docs/guide/using-mdx.md | 6 +- docs/guide/velite-schemas.md | 13 +- docs/guide/with-nextjs.md | 4 +- docs/other/snippets.md | 2 +- docs/reference/api.md | 38 + package.json | 33 +- packages/AGENTS.md | 6 +- packages/next/package.json | 16 +- packages/next/readme.md | 18 + packages/vite/index.d.ts | 9 +- packages/vite/index.js | 16 +- packages/vite/package.json | 16 +- packages/vite/readme.md | 5 +- pnpm-lock.yaml | 7131 ----------------- src/app/engine.ts | 153 + src/app/types.ts | 34 + src/app/watch.ts | 119 + src/assets.ts | 231 - src/assets/image.ts | 49 + src/assets/index.ts | 8 + src/assets/markdown.ts | 81 + src/assets/process.ts | 71 + src/assets/store.ts | 82 + src/build.ts | 275 - src/cli.ts | 4 +- src/collections/cache.ts | 38 + src/collections/discover.ts | 20 + src/{ => collections}/file.ts | 47 +- src/collections/index.ts | 61 + src/collections/resolve.ts | 114 + src/config.ts | 157 - src/config/index.ts | 112 + src/config/load.ts | 199 + src/context.ts | 37 - src/index.ts | 60 +- src/loaders/json.ts | 2 +- src/loaders/matter.ts | 6 +- src/loaders/types.ts | 41 + src/loaders/yaml.ts | 6 +- src/logger.ts | 42 - src/output.ts | 101 - src/output/index.ts | 44 + src/output/state.ts | 14 + src/output/write.ts | 122 + src/runtime/context.ts | 45 + src/runtime/logger.ts | 66 + src/runtime/session.ts | 60 + src/runtime/store.ts | 42 + src/schemas/excerpt.ts | 2 +- src/schemas/file.ts | 12 +- src/schemas/image.ts | 26 +- src/schemas/index.ts | 10 +- src/schemas/markdown.ts | 68 +- src/schemas/mdx.ts | 66 +- src/schemas/metadata.ts | 2 +- src/schemas/path.ts | 2 +- src/schemas/raw.ts | 2 +- src/schemas/toc.ts | 2 +- src/schemas/unique.ts | 68 +- src/state.ts | 1 - src/types.ts | 328 - src/utils.ts | 23 - src/utils/patterns.ts | 26 + test/app/output-recovery.tests.ts | 85 + test/app/watch.tests.ts | 153 + test/{assets.ts => assets/image.tests.ts} | 2 +- test/assets/store.tests.ts | 143 + test/cli/bin.tests.ts | 14 + test/collections/cache.tests.ts | 90 + test/collections/discover.tests.ts | 29 + test/collections/resolve.tests.ts | 233 + test/config/load.tests.ts | 175 + test/{basic.ts => integration/basic.tests.ts} | 54 +- test/integration/nextjs.tests.ts | 41 + test/integration/vite.tests.ts | 41 + test/nextjs.ts | 32 - test/output/state.tests.ts | 19 + test/output/write.tests.ts | 209 + test/packages/plugins.tests.ts | 46 + test/runtime/session.tests.ts | 81 + test/runtime/store.tests.ts | 53 + test/schema.ts | 39 - test/schemas/index.tests.ts | 128 + test/schemas/unique.tests.ts | 37 + test/{utils.ts => utils/patterns.tests.ts} | 2 +- test/vite.ts | 32 - 101 files changed, 4719 insertions(+), 8736 deletions(-) create mode 100644 .agents/sessions/20260617-0000-core-architecture/architecture-review-02.md create mode 100644 .agents/sessions/20260617-0000-core-architecture/architecture-review.md create mode 100644 .agents/sessions/20260617-0000-core-architecture/plan.md create mode 100644 .agents/sessions/20260617-0000-core-architecture/report.md create mode 100644 .agents/sessions/20260617-0000-core-architecture/specs.md delete mode 100755 bin/velite.js delete mode 100644 pnpm-lock.yaml create mode 100644 src/app/engine.ts create mode 100644 src/app/types.ts create mode 100644 src/app/watch.ts delete mode 100644 src/assets.ts create mode 100644 src/assets/image.ts create mode 100644 src/assets/index.ts create mode 100644 src/assets/markdown.ts create mode 100644 src/assets/process.ts create mode 100644 src/assets/store.ts delete mode 100644 src/build.ts create mode 100644 src/collections/cache.ts create mode 100644 src/collections/discover.ts rename src/{ => collections}/file.ts (70%) create mode 100644 src/collections/index.ts create mode 100644 src/collections/resolve.ts delete mode 100644 src/config.ts create mode 100644 src/config/index.ts create mode 100644 src/config/load.ts delete mode 100644 src/context.ts create mode 100644 src/loaders/types.ts delete mode 100644 src/logger.ts delete mode 100644 src/output.ts create mode 100644 src/output/index.ts create mode 100644 src/output/state.ts create mode 100644 src/output/write.ts create mode 100644 src/runtime/context.ts create mode 100644 src/runtime/logger.ts create mode 100644 src/runtime/session.ts create mode 100644 src/runtime/store.ts delete mode 100644 src/state.ts delete mode 100644 src/types.ts delete mode 100644 src/utils.ts create mode 100644 src/utils/patterns.ts create mode 100644 test/app/output-recovery.tests.ts create mode 100644 test/app/watch.tests.ts rename test/{assets.ts => assets/image.tests.ts} (97%) create mode 100644 test/assets/store.tests.ts create mode 100644 test/cli/bin.tests.ts create mode 100644 test/collections/cache.tests.ts create mode 100644 test/collections/discover.tests.ts create mode 100644 test/collections/resolve.tests.ts create mode 100644 test/config/load.tests.ts rename test/{basic.ts => integration/basic.tests.ts} (65%) create mode 100644 test/integration/nextjs.tests.ts create mode 100644 test/integration/vite.tests.ts delete mode 100644 test/nextjs.ts create mode 100644 test/output/state.tests.ts create mode 100644 test/output/write.tests.ts create mode 100644 test/packages/plugins.tests.ts create mode 100644 test/runtime/session.tests.ts create mode 100644 test/runtime/store.tests.ts delete mode 100644 test/schema.ts create mode 100644 test/schemas/index.tests.ts create mode 100644 test/schemas/unique.tests.ts rename test/{utils.ts => utils/patterns.tests.ts} (92%) delete mode 100644 test/vite.ts diff --git a/.agents/sessions/.gitignore b/.agents/sessions/.gitignore index d6b2b0b7..5d9a68ba 100644 --- a/.agents/sessions/.gitignore +++ b/.agents/sessions/.gitignore @@ -4,3 +4,5 @@ # You can temporarily include the current session directory in your branch for a better DX # Remove this before merging, or it will cause noise in master # e.g. `!20260427-1200-schema-refactor` + +!20260617-0000-core-architecture/ diff --git a/.agents/sessions/20260617-0000-core-architecture/architecture-review-02.md b/.agents/sessions/20260617-0000-core-architecture/architecture-review-02.md new file mode 100644 index 00000000..f648960d --- /dev/null +++ b/.agents/sessions/20260617-0000-core-architecture/architecture-review-02.md @@ -0,0 +1,161 @@ +# Architecture Review 02: Important Fixes Recheck + +## Scope + +- Reviewed working tree after addressing Important findings from `architecture-review.md`. +- Focus areas: public/internal API boundary, resolver result assembly, `SessionStore`, watch config dependency reload, programmatic watch lifecycle, asset public API boundary, same-engine output recovery, and output null semantics. +- Verification commands were run after fixes: + - `rtk pnpm build` + - `rtk pnpm test` + - `rtk pnpm docs:build` + +## Result + +No Critical or Important issues remain from the previous architecture review. + +## Fixed Important Findings + +1. Public `context()` no longer exposes `SessionStore`. + + References: + - `src/core/context.ts:10-16` + - `src/core/context.ts:46-56` + - `src/core/context.ts:58-75` + - `src/core/resolver.ts:37-42` + - `src/schemas/file.ts:22-24` + - `src/schemas/image.ts:36-39` + - `src/schemas/markdown.ts:46-48` + - `src/schemas/mdx.ts:26-28` + - `src/schemas/unique.ts:17-18` + - `test/schema.ts:46-55` + + Assessment: + - Public `context()` returns only `{ config, file }`. + - Built-in schemas use `internalContext()` for `store` access. + - Core resolver uses `parseWithInternalContext()` to pass session state. + +2. Resolver preserves falsy parsed results. + + References: + - `src/core/resolver.ts:98-101` + - `test/core-resolver.ts:201-228` + + Assessment: + - Collection assembly now filters only `undefined`. + - Regression test covers `0`, `false`, and `''` outputs. + +3. `SessionStore` correctly caches `undefined` values. + + References: + - `src/core/store.ts:42-50` + - `test/core-store.ts:36-48` + + Assessment: + - `SessionStore.get()` uses `Map.has()` to distinguish an absent key from a stored `undefined` value. + +4. Watch config dependency matching is normalized. + + References: + - `src/core/watch.ts:55-73` + - `test/watch.ts:101-149` + + Assessment: + - Watch events normalize with `resolve(root, filename)`. + - Regression test modifies an imported config dependency (`settings.mjs`) and verifies config reload. + +5. Programmatic watch has a closeable public API. + + References: + - `src/index.ts:33-44` + - `test/schema.ts:12-15` + - `docs/reference/api.md:127-163` + + Assessment: + - New `watch(options)` API builds once and returns a `Watcher` with `close()`. + - `build()` keeps the existing return shape. + +6. Asset helper/type public API boundary is explicit. + + References: + - `src/index.ts:7-15` + - `src/types.ts:1-328` + - `docs/guide/migration.md:131-135` + - `docs/guide/using-mdx.md:349-351` + + Assessment: + - Root exports only stable asset-related public helpers/types: `Image`, `BlurOptions`, `getImageMetadata`, `isRelativePath`. + - `AssetStore` / `AssetRecord` are no longer re-exported from public `types.ts`. + - Migration docs explicitly mark low-level asset collection internals as non-public. + - MDX bundling docs no longer reference internal linked-file plugin helpers. + +7. Same-engine rebuild restores missing data and entry files. + + References: + - `src/core/engine.ts:159-167` + - `src/core/output.ts:29-41` + - `test/output-recovery.ts:58-84` + + Assessment: + - `rebuild()` now calls `writeEntry()` as well as data/assets output. + - `emit()` checks file existence before skipping cached content. + - Regression test deletes the data output directory after the initial build and verifies `items.json`, `index.js`, and `index.d.ts` are restored. + +8. `writeData()` preserves `null` and skips only `undefined`. + + References: + - `src/core/output.ts:87-98` + - `test/core-output.ts:129-140` + + Assessment: + - `null` remains a valid output value. + - `undefined` remains the only skipped value. + +## Residual Minor Risks + +1. `build({ watch: true })` still starts a watcher without returning a close handle. + + References: + - `src/index.ts:21-31` + - `src/index.ts:33-44` + + Assessment: + - This is no longer an Important API gap because a dedicated `watch()` API exists for programmatic callers. + - It is still worth documenting `build({ watch: true })` as CLI/backward-compatible behavior and recommending `watch()` for programmatic use. + +2. Watch lifecycle tests still use `build({ watch: true })` in some cases. + + References: + - `test/watch.ts:35` + - `test/watch.ts:73` + - `test/watch.ts:129` + + Assessment: + - Current tests pass and verify rebuild behavior. + - Future hardening should add tests that call `watch()` directly and close the returned watcher in `finally`. + +3. Integration fixture test still relies on output byte lengths. + + Reference: + - `test/basic.ts:8-34` + + Assessment: + - This predates the Important fixes and is not blocking. + - Future cleanup should parse generated JSON and assert representative content instead of byte length. + +## Verification Evidence + +Latest verification results: + +- `rtk pnpm build`: passed. +- `rtk pnpm test`: passed, 71 tests, 71 pass, 0 fail. +- `rtk pnpm docs:build`: passed. + +Known existing build warning remains: + +- `"Stats" is imported from external module "fs" but never used in "dist/chokidar-JNDIIBE4.js".` + +## Final Assessment + +The Important architecture issues identified in the first review have been addressed. The current state is substantially stronger: public API boundaries are clearer, session state remains internal, resolver/output semantics preserve valid falsy/null values, watch reload behavior has better path handling and coverage, and same-engine output recovery is protected by regression tests. + +The remaining risks are Minor test/documentation hardening tasks, not blockers for the core architecture refactor. diff --git a/.agents/sessions/20260617-0000-core-architecture/architecture-review.md b/.agents/sessions/20260617-0000-core-architecture/architecture-review.md new file mode 100644 index 00000000..5bb5a7d1 --- /dev/null +++ b/.agents/sessions/20260617-0000-core-architecture/architecture-review.md @@ -0,0 +1,237 @@ +# Architecture Review: Core Refactor + +## Scope + +- Reviewed commit range: `29dbb0ca5a170e2161d61e7c02a954f9788b5a77..1c15dbd41249e555f7455a6304335b28ff70923e` +- Reviewed areas: public entry/API boundary, `src/core/*` modularization, `BuildEngine`, `BuildSession`, `SessionStore`, `ParserContext`, config/watch/output behavior, and test coverage. +- Review posture: strict architecture review. Findings below prioritize defects, boundary leaks, and future-maintenance risks over style. + +## Findings + +### Critical + +No Critical issue found that should block the branch immediately. + +### Important + +1. Public `context()` now exposes an internal `SessionStore`, which violates the intended core/internal boundary. + + References: + - `src/index.ts:9` + - `src/core/context.ts:19-26` + - `src/core/context.ts:34-38` + - `src/core/store.ts:8-24` + + Problem: + - `context()` and `parseWithContext()` are still exported from the package root, but their public shape now includes `store: SessionStore`. + - `SessionStore`, `StoreKey`, and `defineStoreKey()` are internal implementation concepts under `src/core/store.ts` and are not exported as a coherent public extension API. + - This creates a half-public API: users can observe `context().store`, but cannot safely define stable keys without importing internal paths. + - It also contradicts the architecture rule that `src/core/*` is internal unless deliberately surfaced through a stable facade. + + Suggested direction: + - Split parser context into a public facade and an internal accessor. + - Keep public `context()` returning only stable user-facing fields, likely `{ config, file }`. + - Add an internal-only `internalContext()` or `parserContext()` used by built-in schemas to access `store`. + - Alternative: explicitly promote `SessionStore`, `StoreKey`, and `defineStoreKey()` to a designed public extension API, document it, and export it from the root. This should be a deliberate product/API decision, not an accidental leak. + +2. The resolver drops valid falsy parsed results. + + Reference: + - `src/core/resolver.ts:98-110` + + Problem: + - `files.flatMap(file => file.result).filter(Boolean)` removes `false`, `0`, and `''` from collection results. + - Zod schemas can legitimately transform or parse records into falsy values. + - This is a behavioral correctness bug in the new resolver assembly path, not just a test gap. + - It is especially risky because the resolver now centralizes collection assembly; this line becomes the authoritative behavior for all collections. + + Suggested direction: + - Replace `.filter(Boolean)` with a predicate that only removes `undefined`, or perhaps `undefined | null` if null should intentionally mean “skip”. + - Add `ContentResolver` tests for `0`, `false`, and `''` outputs, including both array and `single` collections. + +3. `SessionStore.get()` recreates values when a key factory returns `undefined`. + + Reference: + - `src/core/store.ts:42-56` + + Problem: + - The implementation reads `const existing = values.get(key.id)` and treats `existing !== undefined` as the cache-hit condition. + - Because `StoreKey` allows any `T`, `undefined` is a valid TypeScript value unless explicitly excluded. + - A key whose factory returns `undefined` will be recreated every time even though `has(key)` returns true after the first call. + - This weakens the generic store abstraction and can create surprising behavior for future schemas/plugins that use `undefined` as a sentinel state. + + Suggested direction: + - Use `values.has(key.id)` to detect existence, then return `values.get(key.id) as T`. + - Add a store unit test where `defineStoreKey('x', () => undefined)` is created once and `has()` remains consistent. + - If `undefined` should not be supported, encode that constraint in the type and docs instead of relying on map semantics. + +4. Watch config dependency matching is path-shape fragile and insufficiently covered. + + References: + - `src/core/watch.ts:55-59` + - `src/core/watch.ts:65-84` + - `test/watch.ts:64-99` + + Problem: + - The watcher watches both `'.'` with `cwd: root` and absolute `configImports`. + - Event handling converts the event filename with `join(root, filename)` and then checks `configImports.includes(fullpath)`. + - If chokidar emits an absolute path for an absolute watched import, `join(root, filename)` can produce the wrong path shape, so config import changes may not be detected. + - The current test named “config dependency changes” only edits the main `velite.config.mjs`; it does not cover an imported config/helper file. + + Suggested direction: + - Normalize event paths with a single rule, e.g. `resolve(root, filename)`, and compare against a normalized absolute `Set` of `configImports`. + - Add a watch test where `velite.config.mjs` imports `./settings.mjs`, then modifying `settings.mjs` changes output behavior and triggers config reload. + - Include at least one imported config dependency outside the content root if that is supported by `configImports`. + +5. Programmatic watch lifecycle remains effectively unmanageable from the public API. + + References: + - `src/index.ts:21-29` + - `src/core/watch.ts:10-16` + - `test/watch.ts:26-61` + - `test/watch.ts:64-99` + + Problem: + - `createWatchController().start()` returns a `Watcher`, but public `build({ watch: true })` discards it and still returns only `Record`. + - Programmatic callers cannot close the watcher started by `build({ watch: true })`. + - Tests also cannot close the watcher directly; they only delete temporary directories and rely on process behavior. + - The internal `Watcher.close()` design is good, but the public facade hides it, leaving lifecycle control inconsistent with the new architecture. + + Suggested direction: + - Decide whether `watch` is CLI-only or programmatic. + - If programmatic watch is supported, expose a stable handle or add a separate API such as `watch(options)` returning `{ result, close }`. + - If public `build()` must preserve the current return type for 1.0, keep CLI watch on an internal path and consider rejecting/undocumenting `watch: true` for programmatic use. + - Add tests around `WatchController` directly, including closing after config reload to ensure replacement watchers are closed. + +6. Public asset helper exports were narrowed without an explicit compatibility decision. + + References: + - `src/index.ts:7-13` + - `src/core/assets.ts:168-214` + - `src/core/assets.ts:242-281` + - `package.json:22-25` + + Problem: + - The previous root export exposed everything from `src/assets.ts`; the new root export exposes only `getImageMetadata` and `isRelativePath` plus asset-related types. + - `processAsset`, `rehypeCopyLinkedFiles`, and `remarkCopyLinkedFiles` still exist but are no longer reachable through package exports. + - Because `package.json` only exports the package root, users cannot migrate to a documented subpath import. + - This may be acceptable for a 1.0 breaking cleanup, but it should be explicit. Otherwise it is an accidental API break caused by the internal move. + + Suggested direction: + - Either restore selected public exports from `src/index.ts`, or document the removal in migration notes. + - If these helpers are intentionally internal now, keep them non-public and remove public-facing type leaks that imply asset extension support. + - If they are extension points, provide a coherent public facade rather than requiring `src/core/*` imports. + +7. `src/types.ts` re-exports internal asset store types without a complete public asset extension API. + + Reference: + - `src/types.ts:6-10` + + Problem: + - `AssetRecord` and `AssetStore` are publicly exported from `types.ts`, but the functions that create or consume them (`createAssetStore`, `assetStoreKey`, `processAsset`, linked-file plugins) are internal or not exported from the root. + - This exposes internal lifecycle concepts without giving users a stable way to use them. + - It also makes later internal changes to `AssetStore` harder because the type is now part of the root declaration output. + + Suggested direction: + - Remove `AssetRecord` / `AssetStore` from public type exports unless they appear in a public function signature. + - If they are intentionally public, add a public asset extension story and document how custom schemas should interact with assets. + +8. Output recovery is not covered for same-engine rebuilds. + + References: + - `src/core/engine.ts:76-79` + - `src/core/engine.ts:159-165` + - `src/core/output.ts:28-35` + - `test/output-recovery.ts` + - `test/core-output.ts:101-126` + + Problem: + - The engine intentionally shares `outputState` across rebuilds in the same engine/watch session. + - `OutputWriter.emit()` skips writes when content matches cached output. + - If a user deletes `.velite` during watch and then triggers a rebuild with unchanged content, data files can be skipped because `outputState.emitted` still says they were written. + - The existing output recovery test covers two independent public `build()` calls, not `engine.rebuild()` or watch. + + Suggested direction: + - Decide whether manual output deletion during watch should be supported. + - If yes, `emit()` should check file existence before skipping, or engine should invalidate output state when output directories are missing. + - If no, document this as a watch-mode limitation. + - Add an engine-level test that deletes data output after `engine.build()` and calls `engine.rebuild()` with unchanged content. + +### Minor + +1. `test/basic.ts` still uses output byte lengths as integration assertions. + + Reference: + - `test/basic.ts:8-34` + + Problem: + - Byte-length assertions are brittle for formatting changes and weak against same-length behavioral regressions. + - They do not validate collection shape, schema-derived fields, public entry importability, or asset URLs. + + Suggested direction: + - Parse generated JSON and assert representative records and fields. + - Dynamically import the generated `.velite/index.js` and assert export shape. + - Keep a snapshot-like byte check only if there is a specific file-size contract, which does not appear to be the case. + +2. `test/schema.ts` checks public context keys but not AsyncLocalStorage concurrency isolation. + + References: + - `src/core/context.ts:40-65` + - `test/schema.ts:41-50` + + Problem: + - The key risk for `parseWithContext()` is context isolation across concurrent async parses. + - The current test only confirms the current public keys. + + Suggested direction: + - Add a concurrent parse test where two parses with different `file.path` values interleave through async transforms and assert each sees its own context. + +3. `ContentResolver` single-collection edge cases are under-tested. + + References: + - `src/core/resolver.ts:102-106` + - `test/core-resolver.ts` + + Problem: + - There is coverage for the normal single-record case, but not for zero records or multiple records. + - These branches encode public collection semantics (`single: true`) and should be protected during architecture refactors. + + Suggested direction: + - Add tests for empty `single` result throwing and multi-record `single` result selecting the first record while warning. + +4. Config reload tests do not verify stale import-cache avoidance. + + References: + - `src/core/config.ts:150-154` + - `test/core-config.ts:121-145` + + Problem: + - `ConfigLoader` appends a query parameter to avoid ESM import caching. + - The reuse test only compares stable path/import counts; it does not prove that changed config contents are reloaded by the same loader instance. + + Suggested direction: + - Load a config returning output A, modify the config or an imported helper to output B, then load with the same `ConfigLoader` and assert B is observed. + +## Positive Architectural Notes + +- The flat `src/core/` layout is a clear improvement over the previous root-level script structure. +- `BuildSession` now provides a concrete ownership boundary for per-build mutable state. +- `SessionStore` is the right direction for preventing schema-specific fields from accumulating in `ParserContext`. +- `ConfigLoader`, `ContentResolver`, `OutputWriter`, and `WatchController` are independently testable units, which improves maintainability. +- The new unit tests significantly improve coverage of asset deduplication, config loading, output writing, session isolation, and watcher behavior. + +## Recommended Fix Order + +1. Fix `ContentResolver` falsy output handling and add tests for `0`, `false`, and `''`. +2. Fix `SessionStore.get()` to use `Map.has()` and add an `undefined` value test. +3. Resolve the public `context().store` API boundary: either split public/internal context or formalize `SessionStore` as public API. +4. Clarify asset helper/type public API: restore exports or document intentional removal. +5. Harden watch config dependency path matching and add imported-config watch coverage. +6. Decide and document programmatic watch lifecycle behavior; expose/deny a close handle accordingly. +7. Replace byte-length fixture assertions with content-level assertions. + +## Final Assessment + +The refactor is directionally sound and substantially improves internal testability, but it is not yet architecturally sealed. The main remaining risk is not module layout; it is API boundary clarity. `SessionStore` solved the schema-specific context problem internally, but exporting `context()` now leaks that internal mechanism. The second class of issues is behavioral correctness in the new centralized resolver/watch paths, especially falsy outputs and config dependency events. + +Treat this branch as a strong foundation that needs one hardening pass before merge or release. diff --git a/.agents/sessions/20260617-0000-core-architecture/plan.md b/.agents/sessions/20260617-0000-core-architecture/plan.md new file mode 100644 index 00000000..3e7c679e --- /dev/null +++ b/.agents/sessions/20260617-0000-core-architecture/plan.md @@ -0,0 +1,76 @@ +# Core Architecture Refactor — Implementation Plan + +## Goal + +Implement specs.md fully: refactor Velite core into session-isolated architecture with comprehensive test coverage. All phases (1-5) must complete with production-grade code. + +## Baseline + +- Branch: `refactor/core-architecture` +- Tests passing: 17/17 +- `src/core/` exists but empty + +## Phases + +### Phase 1: Core skeleton + +Create `src/core/` modules. No behavior change. + +- `src/core/assets.ts` — `AssetStore`, `AssetRecord` +- `src/core/session.ts` — `BuildSession`, `FileCache`, `UniqueStore`, `OutputState` +- `src/core/config.ts` — `ConfigLoader` (wraps existing config logic) +- `src/core/output.ts` — `OutputWriter` +- `src/core/engine.ts` — `BuildEngine` + +### Phase 2: Move state into BuildSession + +- Add `assets` and `unique` to `ParserContext` +- `processAsset(...)` accepts `AssetStore` parameter +- `s.unique()` uses `context().unique` +- `s.file()`, `s.image()` use `context().assets` +- markdown/mdx schemas pass `AssetStore` to remark/rehype plugins +- `VeliteFile` static cache moves to `session.files` +- Rewire `build.ts` through `BuildEngine` + `BuildSession` +- Remove module-level globals: `loadedFiles`, `assets` Map, `uniqueCache`, `resolved`, `emitted` + +### Phase 3: Split resolver/parser/output + +- `src/core/discover.ts` — file discovery +- `src/core/load.ts` — file loading +- `src/core/parse.ts` — schema parsing +- Refactor `OutputWriter` to expose `writeEntry` + `writeDataAndAssets` +- Session-scoped logger + +### Phase 4: Watch redesign + +- `src/core/watch.ts` — `WatchController` +- Content change → `engine.rebuild()` +- Config change → `engine.build({ ...options, clean: false })` +- Engine exposes `engine.config` +- Add watch regression tests + +### Phase 5: Unit tests + +- Unit tests for AssetStore, UniqueStore, FileCache, OutputState +- Unit tests for ConfigLoader, OutputWriter, ContentResolver +- Keep fixture tests as integration tests + +## Verification gates + +After each phase: + +- `pnpm build` — compiles cleanly +- `pnpm test` — all tests pass +- `pnpm docs:build` — final phase only + +## Acceptance Criteria (from spec §408) + +- [ ] No build-related module-level mutable globals +- [ ] Independent builds isolated by construction +- [ ] `AssetStore.add()` rejects same outputName + different sourcePath +- [ ] `ContentResolver` unit-testable with fakes +- [ ] `OutputWriter` unit-testable without fixture +- [ ] Watch config + content changes have regression coverage +- [ ] `build()` twice with deleted output dir → all JSON regenerated +- [ ] `pnpm build && pnpm test && pnpm docs:build` pass +- [ ] No `src/core/*` accidentally exported as public API diff --git a/.agents/sessions/20260617-0000-core-architecture/report.md b/.agents/sessions/20260617-0000-core-architecture/report.md new file mode 100644 index 00000000..e0287e3d --- /dev/null +++ b/.agents/sessions/20260617-0000-core-architecture/report.md @@ -0,0 +1,91 @@ +# Core Architecture Refactor — Final Report + +## Summary + +Completed the full implementation of the spec on branch `refactor/core-architecture`. Phases 1-5 done; Phase 6 (incremental optimization) intentionally deferred per spec. + +## Final state + +- 61 / 61 tests pass +- `pnpm build` clean +- `pnpm test` clean +- `pnpm docs:build` clean +- No module-level mutable build state in production code paths +- No `src/core/*` re-exported from `src/index.ts` + +## What changed + +### Removed + +- `src/state.ts` (module-level `loadedFiles` map) +- `src/config.ts` (folded into `src/core/config.ts`) +- `src/output.ts` (folded into `src/core/output.ts`) + +### Added (`src/core/`) + +- `assets.ts` — `AssetStore` with content-fingerprint-based dedup +- `unique.ts` — `UniqueStore` +- `file-cache.ts` — session-scoped `FileCache` +- `output-state.ts` — emit cache type +- `session.ts` — `BuildSession` factory +- `types.ts` — internal `Options` +- `discover.ts` — `Discoverer` (injectable glob) +- `resolver.ts` — `ContentResolver` +- `output.ts` — `OutputWriter` (injectable fs + logger) +- `config.ts` — `ConfigLoader` with reusable temp dir +- `engine.ts` — `BuildEngine` with `build` / `rebuild` / `config` +- `watch.ts` — `WatchController` that re-arms on config change + +### Refactored + +- `src/build.ts` — thin facade over `BuildEngine` + `WatchController` +- `src/context.ts` — `ParserContext` exposes `assets` + `unique`; `parseWithContext` accepts partial input +- `src/file.ts` — `VeliteFile` no longer owns a static cache +- `src/assets.ts` — `processAsset()` takes an `AssetStore`; emits a fingerprint +- `src/schemas/file.ts|image.ts|unique.ts|markdown.ts|mdx.ts` — pull state from `context()` +- `src/logger.ts` — `Logger` interface + `createLogger()` + +### Added tests + +- `test/core-assets.ts` — AssetStore + fingerprint collision rule +- `test/core-unique.ts` +- `test/core-file-cache.ts` +- `test/core-output-state.ts` +- `test/core-output.ts` — fake fs +- `test/core-resolver.ts` — fake discoverer +- `test/core-config.ts` — incl. node_modules safety +- `test/core-session.ts` +- `test/output-recovery.ts` — re-emit after rm +- `test/watch.ts` — content + config-change watch tests + +## Acceptance criteria — verified + +| Criterion | Status | +| ------------------------------------------------------------------------------- | :----: | +| No build-related module-level mutable globals | ✅ | +| Independent builds isolated by construction | ✅ | +| `AssetStore.add()` rejects same `outputName` with different content fingerprint | ✅ | +| `ContentResolver` unit-testable with fakes | ✅ | +| `OutputWriter` unit-testable without fixture | ✅ | +| Watch config + content changes have regression coverage | ✅ | +| `build()` twice with data dir deleted regenerates all JSON | ✅ | +| `pnpm build && pnpm test && pnpm docs:build` pass | ✅ | +| `src/core/*` not exported from `src/index.ts` | ✅ | + +## Spec deviations + +1. **AssetStore collision rule** (spec §220): byte-identical files at different paths legitimately produce identical hash-suffixed names. The implementation accepts duplicates when fingerprints match and throws only when fingerprints disagree. Spec text updated. + +2. **Phase 6** (incremental optimization) intentionally deferred per spec. + +## Notes + +- `build()` does not return a watcher handle; matches pre-refactor public API. +- The engine's `outputState` is shared across rebuilds within one engine. Manual file deletion during watch is not detected; users must trigger a content change to regenerate. Acceptable for 1.0; can be improved later by stat'ing in `emit()`. +- Watch tests leak a chokidar watcher into the next test cleanup; `try/catch` swallows ENOENT. No process-level impact. + +## Files changed (summary) + +- 16 modified, 3 deleted, 12 added (production) +- 10 added (tests) +- 2 modified (`AGENTS.md`, `specs.md` — narrative changes only) diff --git a/.agents/sessions/20260617-0000-core-architecture/specs.md b/.agents/sessions/20260617-0000-core-architecture/specs.md new file mode 100644 index 00000000..83c7706f --- /dev/null +++ b/.agents/sessions/20260617-0000-core-architecture/specs.md @@ -0,0 +1,445 @@ +# Core Architecture Design + +## Status + +Draft approved for planning. This document defines the desired internal architecture for Velite 1.0 core refactoring. + +## Context + +Velite started as a small content build utility. The current implementation still works, but the core build flow has outgrown its original script-like structure. Several responsibilities are currently coupled inside `src/build.ts`, and mutable build state is distributed across module-level globals such as loaded files, resolved collections, assets, emitted output cache, and unique value cache. + +This makes the system harder to reason about and hard to unit test. Many tests must run real fixture builds through the package entry instead of testing isolated behavior. Watch mode is especially sensitive because partial rebuild state can become stale when assets, loaded files, config dependencies, or output caches are reused incorrectly. + +The goal of this design is to introduce clear internal architecture boundaries before 1.0 without over-committing to advanced public plugin APIs. + +## Goals + +- Refactor Velite's core from a script-like build flow into a clear build engine. +- Give each build an isolated `BuildSession` that owns state and caches. +- Organize the core flow as pipeline-shaped internal stages: config, discover, load, parse, asset collection, output, hooks, and watch. +- Make core modules unit-testable without always running full fixture builds. +- Keep the public API stable where practical: `build()`, `defineConfig()`, schemas, and config hooks. +- Keep room for future pipeline/plugin extension points without exposing them prematurely. + +## Non-Goals + +- Do not expose a full stage-based plugin API in 1.0. +- Do not introduce heavy abstractions such as a dependency injection container or event bus. +- Do not rewrite every schema, loader, and output detail at once. +- Do not optimize watch mode for fine-grained incremental rebuilds before state ownership is correct. +- Do not export `src/core/*` as public API. + +## Design Principle + +Use approach B as the architecture and approach C as the internal shape: + +- Build a clear internal core architecture first. +- Shape the internals like a pipeline so future extension points can wrap existing stages. +- Keep public extension APIs conservative for 1.0 because current config hooks are enough for short-term needs. + +## Proposed Module Layout + +```text +src/ + index.ts public API entry and build() facade + cli.ts CLI entry + types.ts public TypeScript interfaces and selected public type re-exports + loaders/ built-in loaders + schemas/ custom Zod schemas + core/ + engine.ts BuildEngine orchestration + session.ts BuildSession and state/cache lifecycle + store.ts typed, session-scoped state registry + context.ts parser context with { config, file, store } + file.ts VeliteFile loading/data object + logger.ts Logger interface and default logger + utils.ts internal utilities + config.ts ConfigLoader and temporary config bundle lifecycle + discover.ts content file discovery + assets.ts asset helpers/plugins, AssetStore, assetStoreKey + unique.ts UniqueStore and uniqueStoreKey + output.ts OutputWriter + watch.ts WatchController +``` + +### Public Facade + +`src/index.ts` owns the public `build()` facade. It receives `Options`, creates or delegates to the core engine, and returns the build result. It should not directly own caches, asset state, file discovery, parsing, output writing, or watch orchestration. + +The root `src/` directory should stay slim: public entry (`index.ts`), CLI entry (`cli.ts`), public types (`types.ts`), loaders, schemas, and the flat `core/` implementation directory. Do not introduce nested `core/` subdirectories unless there is a clear need. + +### Core Modules + +`src/core/*` is internal. It must not be exported directly from `src/index.ts`. If a stable public type is needed, expose it through `src/types.ts` instead of exporting internal modules. + +This avoids accidental public APIs such as internal cache clearing helpers. + +`ConfigLoader` owns the lifecycle of temporary config bundles created by esbuild. It should decide where compiled config files live, how dependency resolution works from that location, and when stale temporary files or symlinks are replaced. User config compilation must not write into user `node_modules`. + +When the same `ConfigLoader` is used across watch reloads in a long-running engine, it should replace the previous temporary bundle in place rather than accumulating one bundle per reload. + +`core/assets.ts` should contain asset helpers, plugin factories, the session-owned `AssetStore`, and `assetStoreKey`. Public helpers such as `isRelativePath()` and `getImageMetadata()` may be re-exported from `src/index.ts`, but implementation stays in core. + +## Build Data Flow + +One build should follow a clear data flow: + +```text +build(options) + -> ConfigLoader.load(options) + -> BuildSession.create(config, options) + -> OutputWriter.writeEntry(session) + -> ContentResolver.resolve(session) + -> OutputWriter.writeDataAndAssets(session, resolved) + -> run complete hook + -> optionally WatchController.start(engine, config) + -> return result +``` + +The internal engine should expose a small contract: + +```ts +type BuildEngine = { + build(options: Options): Promise + rebuild(): Promise + readonly config: Config | undefined +} +``` + +`Result` is the current public build result shape, equivalent to `Record`. Do not widen the public `build()` return value in this refactor. + +`rebuild()` creates a fresh `BuildSession` from the engine's current resolved config. It does not reload config, does not honor `output.clean`, and does not rerun `OutputWriter.writeEntry()`. It still ensures output directories exist before writing. Config reload and entry regeneration belong to the watch branch that handles config dependency changes. + +The engine should expose its current resolved config internally as `engine.config` after `build()` completes so `WatchController` can re-arm itself with updated `configImports` and collection patterns after a config dependency reload. This must not change the public `build()` return value. + +Expanded flow: + +```text +Options + -> ConfigLoader + -> ResolvedConfig + -> BuildSession + -> OutputWriter writes entry and d.ts from config collections + -> Discover collection file paths + -> Load VeliteFile objects + -> Parse records with ParserContext + -> Build Result and file messages + -> Prepare hook + -> OutputWriter writes JSON data and assets + -> Complete hook +``` + +`OutputWriter.writeEntry()` may run before content resolution because entry files and type declarations depend on the resolved config and collection schemas, not on parsed content results. Content changes in watch mode do not need to rewrite entry files; config dependency changes reload config and start a fresh build, which rewrites entry files. + +## Parser Context + +`ParserContext` should expose only the capabilities schema callbacks need. It should not expose the whole session and should not grow schema-specific fields. + +Proposed shape: + +```ts +type ParserContext = { + config: Config + file: VeliteFile + store: SessionStore +} +``` + +`SessionStore` is a typed, session-scoped registry: + +```ts +type StoreKey = { + readonly id: symbol + readonly create: () => T +} + +type SessionStore = { + get(key: StoreKey): T + has(key: StoreKey): boolean +} +``` + +Schemas such as `s.file()` and `s.image()` should collect assets through `context().store.get(assetStoreKey)` rather than writing to a module-level asset map or requiring `ParserContext.assets`. + +Schemas such as `s.unique()` should use `context().store.get(uniqueStoreKey)` rather than a module-level unique cache or requiring `ParserContext.unique`. This keeps unique value state inside the current session while keeping the parser context generic. + +Markdown and MDX linked-file copying currently runs inside remark/rehype plugins created by the markdown/mdx schemas. Those plugins should receive `AssetStore` explicitly when they are constructed, instead of relying on a module-level asset map. `AsyncLocalStorage` usually propagates through promise chains, but explicit injection is clearer and avoids hidden assumptions if unified internals change. + +Existing public `context()` behavior should remain stable for user code. New fields should be added carefully and documented only if they are meant to be public. + +## Hook Context + +Existing config hooks should remain conservative: + +```ts +prepare(result, { config }) +complete(result, { config }) +``` + +The core may use a richer internal session, but `HookContext` should not automatically expose session internals. This keeps the 1.0 public API smaller and easier to maintain. + +## BuildSession State Model + +All build-scoped mutable state should belong to `BuildSession`. + +```ts +type BuildSession = { + config: Config + options: Options + files: FileCache + resolved: CollectionCache + store: SessionStore + output: OutputState +} +``` + +`options` stored on the session is the resolved options object after defaults have been applied, not the raw user input. This avoids duplicate defaulting logic across engine and session code. + +If a session identifier becomes useful for logs or debug traces, add it later as an internal optional field. It is not required for the core state model. + +Rules: + +- A normal `build()` creates a fresh session. +- Sessions are not reused across independent builds. +- Module-level mutable build state should be eliminated. +- Utility functions, schema factories, and public facades can remain module-level if they are stateless. +- `AsyncLocalStorage` may continue to hold the current parser context during parsing, but the context should point at current session-owned capabilities. + +`VeliteFile` should no longer own a static global file cache. File caching should move to a session-owned file cache, for example: + +```ts +type FileCache = { + get(path: string): VeliteFile | undefined + load(path: string, loaders: Loader[]): Promise +} +``` + +The preferred migration path is `session.files.load(path, loaders)` and `session.files.get(path)` rather than adding cache parameters to `VeliteFile.create()` or using another `AsyncLocalStorage` lookup. `VeliteFile` should remain the loaded file data object, not the cache manager. + +## AssetStore + +`AssetStore` should represent assets collected during the current session. + +Future-friendly asset records should include source ownership: + +```ts +type AssetRecord = { + sourcePath: string + outputName: string + publicUrl: string + ownerFiles: Set +} + +type AssetStore = { + add(record: { sourcePath: string; outputName: string; publicUrl: string; ownerFile: string }): AssetRecord + list(): AssetRecord[] + byOwner(file: string): AssetRecord[] +} +``` + +`outputName` is the rendered output filename, such as `cover-a1b2c3d4.png`. It should be the asset output key. `sourcePath` is the original absolute file path. `publicUrl` is the final URL exposed in parsed content. `ownerFiles` records every content file that caused this asset to be collected. + +`AssetStore.add()` should be idempotent for the same `outputName`. The same `outputName` with a different `sourcePath` is accepted when the caller proves the source content is byte-identical (typically by passing a content fingerprint). Different content under the same `outputName` is a hard error because it indicates a hash collision or an unsafe filename template. + +This allows future incremental watch mode to remove assets owned by a changed file while keeping assets still owned by other files. The 1.0 implementation does not need fine-grained incremental asset updates, but it should avoid designs that make them impossible. + +## UniqueStore + +The unique value cache should become session-owned: + +```ts +type UniqueStore = { + register(group: string, value: string, file: string): string | undefined +} +``` + +`group` matches the current `s.unique(group)` namespace. It is not necessarily a collection name. `register()` returns the conflicting file path when the value already exists, or `undefined` after registering a new value. This preserves the existing duplicate error message that includes the conflicting path. + +Independent builds should not need global reset calls. Watch mode can create a fresh session per rebuild until a proper dependency graph exists; see Open Follow-Up: incremental rebuilds. + +## Diagnostics + +Do not introduce a separate `Diagnostics` store in the first refactor unless it has clear producers and consumers. Current diagnostics live on `VeliteFile` as vfile messages and are reported by the resolver. The initial core split should keep that behavior: parser and loader issues attach to files, and `ContentResolver` derives reports from resolved files. A dedicated diagnostics object can be introduced later if hooks or tooling need a structured diagnostic API. + +## OutputState + +Data output caching can be session-owned or watch-owned. Independent `build()` calls must not reuse a previous call's data emit cache, because a user may delete the output directory between builds. Watch mode may keep output cache in watch state, but it must not affect fresh non-watch builds. + +Minimal shape: + +```ts +type OutputState = { + emitted: Map +} +``` + +`emitted` is keyed by output path and stores the last written content for data/entry skip-if-same behavior. Asset output does not belong in this cache in the initial design; assets should be copied from the current `AssetStore`, or later cached by target path plus content hash/mtime if needed. + +Asset output should not use an incomplete cache keyed only by asset name and source path. + +Safer options: + +- Always copy assets from the current `AssetStore`. +- Or cache by target path and content hash/mtime if performance becomes important. + +Data file output can keep content-based skipping because the target path and content are known. + +## Watch Strategy + +For 1.0, watch mode should prefer correctness over fine-grained incremental performance. + +```text +watch event + -> if config dependency changed: + close watcher + call the config-reload path + re-arm watcher with new resolved config + -> if content changed: + create new BuildSession + full resolve + output current result/assets +``` + +`WatchController` responsibilities: + +- Create and close chokidar watchers. +- Classify events. +- Detect config dependency changes. +- Trigger `engine.rebuild()` on content changes and the config-reload path on config dependency changes. +- Avoid direct cache mutation, parsing, or output writing. + +`WatchController` should not hold a `BuildSession`. It holds the engine and current config. On each content change it calls `engine.rebuild()` to create a fresh session. The old session is no longer referenced and can be garbage-collected. + +The config-reload path should call internal `engine.build({ ...options, clean: false })` rather than recursing through the public `build()` facade. Watch reloads must explicitly pass `clean: false`; the engine itself does not track whether `clean` has already been honored. The watch controller then reads `engine.config` and re-arms itself with the new `configImports` and collection patterns. + +Fine-grained incremental rebuilds should be a later optimization based on explicit data structures such as `AssetStore.ownerFiles` and a dependency graph. + +This is an intentional performance trade-off. The current implementation has a `changed` path that can skip some unchanged files. The first core watch redesign may move single-file changes from roughly changed-file work toward full-project work. That trade-off is acceptable for 1.0 correctness, but it should be measured on larger content projects before release if watch performance is a concern. + +## Testing Strategy + +Testing should use three layers. + +### Unit Tests + +Core modules should be testable with fake dependencies: + +- `ConfigLoader` +- `AssetStore` +- `ContentResolver` +- `OutputWriter` +- `BuildSession` + +Use selective dependency injection rather than full virtualization. Only modules that perform direct IO should accept dependency objects. `OutputWriter` should accept filesystem dependencies, and `Discover` should accept glob dependencies. Other modules should prefer direct values or synthetic inputs in tests. + +Example dependency shape: + +```ts +type CoreDeps = { + fs: FileSystem + glob: Glob + logger: Logger +} +``` + +Default dependencies use real implementations. Unit tests pass hand-written fakes where needed. Use the repository's existing `node:test` stack rather than adding a new test framework just for core unit tests. + +Logger should become session-scoped for core execution. The public facade may keep a module-level logger export for compatibility, but core modules should receive the session logger through dependencies or session context instead of mutating a process-level singleton during builds. This avoids log-level races between concurrent builds and makes log output testable. + +### Integration Tests + +Keep real fixture tests for: + +- basic project +- Next.js project +- Vite project + +These verify package entry behavior and real application integration. + +### Regression Tests + +Keep or add focused tests for known architectural failure modes: + +- Consecutive builds do not reuse unique values. +- Consecutive builds do not reuse assets. +- Consecutive builds do not skip asset copies due to cross-build state. +- Config compilation does not write to user `node_modules`. +- Config dependencies resolve to correct absolute paths. +- Calling `build()` twice with the data output directory deleted between calls produces all expected JSON files on the second call. +- Watch content changes do not output stale assets. +- Watch config dependency changes reload config. + +## Migration Plan + +### Phase 1: Create Core Skeleton Without Behavior Changes + +- Create `src/core/`. +- Add initial core modules listed in the layout that are needed at this stage: `session.ts`, `store.ts`, `engine.ts`, `assets.ts`, `output.ts`, `config.ts`. Defer `discover.ts`, `resolver.ts`, and `watch.ts` until their phases. +- Keep `index.ts` as the public facade, including `build()`. +- Move existing logic behind the facade without intentionally changing behavior. +- Keep existing tests passing. +- Keep `ConfigLoader` responsible for temporary config bundle paths, dependency resolution from the temp location, and stale temp symlink replacement. + +### Phase 2: Move Mutable Build State Into BuildSession + +- Move schema-owned state into `BuildSession.store`. +- Move loaded files into `BuildSession.files`. +- Move asset collection behind `assetStoreKey`. +- Move unique cache behind `uniqueStoreKey`. +- Move resolved collections into `BuildSession.resolved`. +- Move output state into session or watch state. +- Replace `VeliteFile.get/create` cache ownership with `session.files.get/load`. +- Wire session-owned `store` into the existing parser context as part of this phase. Do not leave an intermediate state where schemas still rely on module-level globals. +- Remove module-level mutable build state. + +### Phase 3: Split Resolver, Parser, and Output Writer + +- Split current resolve logic into discovery, load, parse, file-message reporting, and result assembly. +- Make `OutputWriter` responsible only for entry, type declarations, JSON data, and assets. +- Adjust schemas (`s.file()`, `s.image()`, `s.unique()`, markdown/mdx) to consume the parser-context capabilities introduced in Phase 2 instead of direct globals. +- Pass `AssetStore` explicitly into remark/rehype linked-file plugins when markdown/mdx schemas construct them. +- Construct a session-scoped logger and pass it through core dependencies or session context. Keep any public logger facade as compatibility glue, not as core build state. + +### Phase 4: Rebuild Watch Around Correctness + +- Introduce `WatchController`. +- Reload config on config dependency changes. +- Use a new session and full resolve on content changes. +- Do not let `WatchController` retain build sessions across content-change events. +- Add watch regression tests. + +### Phase 5: Add Unit Test Coverage + +- Add unit tests for config loading, asset store, output writer, content resolver, and session lifecycle. +- Keep fixture tests as integration tests. + +### Phase 6: Optional Incremental Optimization + +- Add source ownership and dependency graph based incremental rebuilds only if watch performance becomes a proven problem. +- Do not make this a required 1.0 milestone. + +## Compatibility Strategy + +- Keep `build(options)` stable. +- Keep `defineConfig`, `defineCollection`, and `defineSchema` stable. +- Keep schema public APIs stable where practical. +- Keep `prepare` and `complete` config hooks stable. +- Do not export `src/core/*`. +- Do not expose a stage-based plugin API in 1.0. +- Document core architecture in contributor-facing docs only, not public API reference. + +## Acceptance Criteria + +- Build-related mutable state is no longer stored in module-level globals. +- Independent builds are isolated by construction, not by manual global reset calls. +- `AssetStore.add()` rejects two records with the same `outputName` whose source content differs. +- `ContentResolver` can be unit-tested with fake file data and fake loaders. +- `OutputWriter` can be unit-tested without running a full fixture project. +- Watch config changes and content changes have regression coverage. +- Calling `build()` twice with the data output directory deleted between calls produces all expected JSON files on the second call. +- Existing `pnpm build`, `pnpm test`, and `pnpm docs:build` pass. +- No internal core module is accidentally exported as public API. + +## Open Follow-Up + +Watch mode intentionally starts with full rebuilds for correctness. This may regress single-file watch rebuild performance from changed-file work toward full-project work. If performance becomes an issue, introduce incremental rebuilds later using explicit ownership and dependency graph data structures. diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 01bf51a9..71785aba 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,18 +20,31 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - name: Checkout + uses: actions/checkout@v5 with: fetch-depth: 0 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v6 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node + uses: actions/setup-node@v6 with: - node-version: 22 + node-version: 24 cache: pnpm - - uses: actions/configure-pages@v5 - - run: pnpm install - - run: pnpm docs:build && touch docs/.vitepress/dist/.nojekyll - - uses: actions/upload-pages-artifact@v4 + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build with VitePress + run: pnpm docs:build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: path: docs/.vitepress/dist @@ -41,5 +54,8 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} needs: build runs-on: ubuntu-latest + name: Deploy steps: - - uses: actions/deploy-pages@v4 + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0221e6b7..1b597bfb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,23 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v6 + - name: Checkout + uses: actions/checkout@v5 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node + uses: actions/setup-node@v6 with: - node-version: lts/* + node-version: 22.13.0 cache: pnpm - - run: pnpm install - - run: pnpm build - - run: pnpm test + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build + + - name: Test + run: pnpm test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ec7a05b2..f40b6f72 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,28 +1,58 @@ name: Publish on: - push: - tags: - - v* + release: + types: [published] + workflow_dispatch: permissions: - id-token: write # Required for OIDC contents: read + id-token: write jobs: publish: - # prevents this action from running on forks - if: github.repository == 'zce/velite' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v6 + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup pnpm + uses: pnpm/action-setup@v6 + + - name: Setup Node.js + uses: actions/setup-node@v6 with: - node-version: lts/* - registry-url: https://registry.npmjs.org/ - package-manager-cache: false # never use caching in release builds - - run: pnpm install - - run: pnpm build - - run: pnpm test - - run: pnpm publish --no-git-checks + node-version: 22.13.0 + registry-url: https://registry.npmjs.org + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build + + - name: Test + run: pnpm test + + - name: Build docs + run: pnpm docs:build + + - name: Resolve npm tag + run: | + if [ "${{ github.event.release.prerelease }}" = "true" ]; then + echo "NPM_TAG=next" >> "$GITHUB_ENV" + elif node -e "process.exit(require('./package.json').version.includes('-') ? 0 : 1)"; then + echo "NPM_TAG=next" >> "$GITHUB_ENV" + else + echo "NPM_TAG=latest" >> "$GITHUB_ENV" + fi + + - name: Publish core package + run: pnpm --filter velite publish --access public --provenance --no-git-checks --tag "$NPM_TAG" + + - name: Publish Next.js plugin + run: pnpm --filter @velite/plugin-next publish --access public --provenance --no-git-checks --tag "$NPM_TAG" + + - name: Publish Vite plugin + run: pnpm --filter @velite/plugin-vite publish --access public --provenance --no-git-checks --tag "$NPM_TAG" diff --git a/.vscode/settings.json b/.vscode/settings.json index 5ca266b9..29888005 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,5 +9,6 @@ "files.exclude": { "**/node_modules": true }, - "typescript.tsdk": "node_modules/typescript/lib" + "js/ts.referencesCodeLens.enabled": true, + "js/ts.tsdk.path": "node_modules/typescript/lib" } diff --git a/AGENTS.md b/AGENTS.md index 6f7a839f..20d0fd0c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,36 +20,34 @@ Velite — a tool that turns Markdown / MDX, YAML, JSON into a type-safe data la - Root package is the core library (`velite` on npm) - `packages/next` → `@velite/plugin-next` (Next.js integration, hand-written JS) - `packages/vite` → `@velite/plugin-vite` (Vite integration, hand-written JS) -- ESM-only (`"type": "module"`), Node.js >=20.19.0 +- ESM-only (`"type": "module"`), Node.js >=22.13.0 ## Source layout (`src/`) -| File | Role | -| ------------ | ----------------------------------------------------------------------------------------------------------------------------------- | -| `index.ts` | Public API barrel export | -| `cli.ts` | CLI entry (`velite build` / `velite dev`) | -| `build.ts` | Core build orchestration, watch mode | -| `config.ts` | Config resolution (bundles user config via esbuild) | -| `context.ts` | Schema parsing with Zod context | -| `file.ts` | `VeliteFile` — file loading and record extraction | -| `output.ts` | Data/asset output, `.d.ts` generation | -| `assets.ts` | Asset tracking and deduplication | -| `state.ts` | Global build state | -| `logger.ts` | Logging with levels | -| `types.ts` | All TypeScript interfaces (`Config`, `UserConfig`, `Collection`, etc.) | -| `utils.ts` | Pattern matching utilities | -| `loaders/` | Built-in loaders: `json`, `yaml`, `matter` (frontmatter) | -| `schemas/` | Custom Zod extensions: `file`, `image`, `markdown`, `mdx`, `slug`, `toc`, `excerpt`, `metadata`, `path`, `raw`, `isodate`, `unique` | +| File | Role | +| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `index.ts` | Public API entry and barrel, including public helpers/types plus the public `build()` facade | +| `cli.ts` | CLI entry (`velite build` / `velite dev`) | +| `app/` | Application orchestration: `Engine`, watch controller, and build options | +| `config/` | Public config types/helper plus runtime config loading/bundling | +| `collections/` | Public collection types/helper plus discovery, resolving, `VeliteFile`, and file cache | +| `output/` | Public output type plus generated entry/data/assets writing and emit cache | +| `assets/` | Asset store, asset path processing, image metadata, and Markdown/MDX linked-file plugins | +| `runtime/` | Schema parsing context, session store, build session, and logger | +| `loaders/` | Built-in loaders: `json`, `yaml`, `matter` (frontmatter) | +| `schemas/` | Custom Zod extensions: `file`, `image`, `markdown`, `mdx`, `slug`, `toc`, `excerpt`, `metadata`, `path`, `raw`, `isodate`, `unique` | +| `utils/` | Small shared utilities such as pattern matching | ## Key patterns - `s` is the extended Zod namespace (`src/schemas/index.ts:16`) — re-exports all of `zod` plus custom schemas -- User config files (`velite.config.{js,ts,mjs,mts,cjs,cts}`) are bundled with esbuild at runtime, not imported directly (`src/config.ts:69`) -- Config is searched up to 3 parent directories from cwd (`src/config.ts:21`) +- User config files (`velite.config.{js,ts,mjs,mts,cjs,cts}`) are bundled with esbuild at runtime, not imported directly (`src/config/load.ts`) +- Config is searched up to 3 parent directories from cwd (`src/config/load.ts`) - Default content root: `content/`, default output: `.velite/` (data) + `public/static/` (assets) - `defineConfig`, `defineCollection`, `defineLoader`, `defineSchema` are identity helpers for type inference only - The `prepare` hook can return `false` to suppress default file output - Tests use Node's built-in test runner (`node:test`), not Jest/Vitest +- All build-scoped mutable state lives on `BuildSession` (`src/runtime/session.ts`) and its `SessionStore`; independent builds are isolated by construction ## Code style @@ -60,21 +58,24 @@ Velite — a tool that turns Markdown / MDX, YAML, JSON into a type-safe data la ## Testing ```bash -pnpm test # runs: node --import tsx --test test/*.ts +pnpm test # runs: node --import tsx --test test/**/*.tests.ts ``` - Tests in `test/` use `node:test` + `node:assert` - Tests run against the **built** output (`dist/`), so `pnpm build` must run first -- `test/basic.ts` builds the `examples/basic` fixture and checks output file sizes +- `test/basic.ts` builds the `examples/basic` fixture and checks generated output content - Tests clean up `.velite` output dirs after running ## Gotchas -- `bin/velite.js` imports `../dist/cli.js` — you must build before running the CLI from source +- The package bin points to `dist/cli.js`; `tsup` injects the Node shebang during build - The `tsup` config injects a `require` shim banner for CJS interop in the ESM output +- Bundling strategy intentionally follows tsup defaults: `dependencies` stay external, while runtime internals listed only in `devDependencies` are bundled into `dist/` +- When adding runtime imports, put public API/native/heavy/override-sensitive deps in `dependencies`; put pure internal implementation tools in `devDependencies` so they are bundled +- After changing dependency groups, run `pnpm build` and check `dist/` for unexpected bare imports - `sharp` and `esbuild` are allowed native builds in `pnpm-workspace.yaml` - Config bundling uses `packages: 'external'` — user deps are not bundled into config output -- The `unique` schema (`src/schemas/unique.ts`) uses a global cache that must be reset between builds (`clearBuildState` in `build.ts:23`) +- Internal modules are exposed through `src/index.ts` only when intentionally public; do not re-export implementation folders wholesale ## Session workspace diff --git a/bin/velite.js b/bin/velite.js deleted file mode 100755 index 5f5ecc9b..00000000 --- a/bin/velite.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -import('../dist/cli.js') -// for worksapce development diff --git a/docs/guide/define-collections.md b/docs/guide/define-collections.md index a7d5726e..a3a895e5 100644 --- a/docs/guide/define-collections.md +++ b/docs/guide/define-collections.md @@ -67,7 +67,7 @@ const posts = defineCollection({ }) ``` -Velite uses [fast-glob](https://github.com/mrmlnc/fast-glob) to find content files, so you can use any glob pattern supported by fast-glob. +Velite uses [tinyglobby](https://github.com/SuperchupuDev/tinyglobby) to find content files, so you can use glob patterns compatible with tinyglobby. By default, Velite will ignore files and directories that start with `_` or `.`. @@ -86,14 +86,14 @@ const site = defineCollection({ Velite uses [Zod](https://zod.dev) to validate the content items in a collection. The `schema` option is used to define the Zod schema used to validate the content items in the collection. -To use Zod in Velite, import the `z` utility from `'velite'`. This is a re-export of Zod's `z` object, and it supports all of the features of Zod. See [Zod's Docs](https://zod.dev) for a complete documentation on how Zod works and what features are available. +To define schemas in Velite, import the `s` utility from `'velite'`. It includes all Zod schema helpers plus Velite-specific schemas for content projects. See [Zod's Docs](https://zod.dev) for complete documentation on how Zod works and what features are available. ```js -import { z } from 'velite' +import { s } from 'velite' const posts = defineCollection({ - schema: z.object({ - title: z.string().max(99) + schema: s.object({ + title: s.string().max(99) }) }) ``` @@ -104,7 +104,7 @@ The schema is usually a `ZodObject`, validating the shape of the content item. B ::: -For more complex schemas, I recommend that you use [Velite extended schemas `s`](velite-schemas.md): +For more complex schemas, use [Velite extended schemas `s`](velite-schemas.md): - `s.slug()`: validate slug format, unique in posts collection. - `s.isodate()`: format date string to ISO date string. diff --git a/docs/guide/migration.md b/docs/guide/migration.md index 22276903..5dc58d1a 100644 --- a/docs/guide/migration.md +++ b/docs/guide/migration.md @@ -19,19 +19,19 @@ pnpm add -D @velite/plugin-vite@latest ## Runtime Requirements -Velite now targets Node.js `>=20.19.0`. +Velite now targets Node.js `>=22.13.0`. This aligns the package with current versions of the runtime dependencies used by the build and watch pipeline. Update local development, CI, and deployment environments before upgrading. ## Zod 4 Schema Semantics -Velite now uses the official `zod` package directly. The `s` helper still includes Velite-specific schemas and all Zod exports, and `z` is also exported from `velite` for code that prefers the Zod namespace. +Velite now uses the official `zod` package internally. The `s` helper is the public schema namespace and includes Velite-specific schemas plus all Zod schema helpers. Use `s` instead of importing `z` from `velite`. ```ts -import { s, z } from 'velite' +import { s } from 'velite' const post = s.object({ - title: z.string(), + title: s.string(), slug: s.path() }) ``` @@ -128,6 +128,12 @@ s.string().transform(value => { Only call `ctx.addIssue()` when the current value should fail validation. +## Asset Internals + +Velite 1.0 keeps low-level asset collection state internal. Custom schemas should use public schemas such as `s.file()` and `s.image()` for asset references, or return their own URLs directly. + +The internal asset store, linked-file remark/rehype plugins, and `processAsset()` are not public extension APIs. Do not import from `velite/dist/*` or source internals such as `src/assets/*`; those paths are implementation details and may change without a compatibility layer. + ## Next.js Integration Use `@velite/plugin-next` instead of manually starting Velite from `next.config.ts`. @@ -182,20 +188,19 @@ export default defineConfig({ ## Type Exports -The public entry exports Zod-related helpers for schema typing: +The public entry exports Zod-related type helpers for schema typing: ```ts -import { z } from 'velite' - -import type { infer, Schema, ZodType } from 'velite' +import type { infer, Schema } from 'velite' ``` Use `context()` for Velite parser metadata instead of relying on `ZodMeta`. ## Recommended Upgrade Checklist -- Update Node.js to `>=20.19.0` in local development and CI. +- Update Node.js to `>=22.13.0` in local development and CI. - Upgrade `velite` to `1.0.0-alpha.2`. +- Replace `import { z } from 'velite'` with `import { s } from 'velite'`. - Replace `ctx.meta` access with `context()`. - Add `.optional()` to custom schemas that derive missing object fields from the current file. - Remove `ctx.addIssue({ fatal: false, ... })` warning patterns. diff --git a/docs/guide/quick-start.md b/docs/guide/quick-start.md index 607fd772..ba1a5e98 100644 --- a/docs/guide/quick-start.md +++ b/docs/guide/quick-start.md @@ -4,7 +4,7 @@ ### Prerequisites -- [Node.js](https://nodejs.org) version 18.20 or higher, LTS version is recommended. +- [Node.js](https://nodejs.org) version 22.13 or higher, LTS version is recommended. - macOS, Windows, and Linux are supported. ::: code-group diff --git a/docs/guide/using-mdx.md b/docs/guide/using-mdx.md index 2001e7f1..49b4038d 100644 --- a/docs/guide/using-mdx.md +++ b/docs/guide/using-mdx.md @@ -282,7 +282,7 @@ const compileMdx = async (source: string, path: string, options: CompileOptions) absWorkingDir: dirname(path), write: false, bundle: true, - target: 'node18', + target: 'node22', platform: 'neutral', format: 'esm', globalName: 'VELITE_MDX_COMPONENT', @@ -324,7 +324,6 @@ export const mdxBundle = (options: MdxOptions = {}) => const enableGfm = options.gfm ?? config.mdx?.gfm ?? true const enableMinify = options.minify ?? config.mdx?.minify ?? true const removeComments = options.removeComments ?? config.mdx?.removeComments ?? true - const copyLinkedFiles = options.copyLinkedFiles ?? config.mdx?.copyLinkedFiles ?? true const outputFormat = options.outputFormat ?? config.mdx?.outputFormat ?? 'function-body' const remarkPlugins = [] as PluggableList @@ -332,7 +331,6 @@ export const mdxBundle = (options: MdxOptions = {}) => if (enableGfm) remarkPlugins.push(remarkGfm) // support gfm (autolink literals, footnotes, strikethrough, tables, tasklists). if (removeComments) remarkPlugins.push(remarkRemoveComments) // remove html comments - if (copyLinkedFiles) remarkPlugins.push([remarkCopyLinkedFiles, config.output]) // copy linked files to public path and replace their urls with public urls if (options.remarkPlugins != null) remarkPlugins.push(...options.remarkPlugins) // apply remark plugins if (options.rehypePlugins != null) rehypePlugins.push(...options.rehypePlugins) // apply rehype plugins if (config.mdx?.remarkPlugins != null) remarkPlugins.push(...config.mdx.remarkPlugins) // apply global remark plugins @@ -349,6 +347,8 @@ export const mdxBundle = (options: MdxOptions = {}) => }) ``` +This example does not copy relative assets referenced from MDX. Use the built-in `s.mdx()` schema if you need Velite-managed linked-file copying, or add your own public remark/rehype plugin that returns URLs managed by your application. + Then, you can use the custom schema in your `velite.config.js`: ```js {10} diff --git a/docs/guide/velite-schemas.md b/docs/guide/velite-schemas.md index d5e98ea6..b8bb2767 100644 --- a/docs/guide/velite-schemas.md +++ b/docs/guide/velite-schemas.md @@ -1,22 +1,13 @@ # Velite Schemas -To use Zod in Velite, import the `z` utility from `'velite'`. This is a re-export of the Zod library, and it supports all of the features of Zod. +To use Zod in Velite, import the `s` utility from `'velite'`. It includes all Zod schema helpers plus Velite-specific schemas for content projects. See [Zod's Docs](https://zod.dev) for complete documentation on how Zod works and what features are available. -```js -import { z } from 'velite' - -// `z` is re-export of Zod -``` - -In addition, Velite has extended Zod schemas, added some commonly used features when building content models, you can import `s` from `'velite'` to use these extended schemas. - ```js import { s } from 'velite' -// `s` is extended from Zod with some custom schemas, -// `s` also includes all members of zod, so you can use `s` as `z` +// `s` includes Zod helpers and Velite custom schemas. ``` ## `s.isodate()` diff --git a/docs/guide/with-nextjs.md b/docs/guide/with-nextjs.md index a09cedaa..f24fa011 100644 --- a/docs/guide/with-nextjs.md +++ b/docs/guide/with-nextjs.md @@ -152,6 +152,8 @@ In this case, you can specify a more specific type for the relevant schema to ma e.g. ```ts +import { defineCollection, s } from 'velite' + import type { Route } from 'next' import type { Schema } from 'velite' @@ -159,7 +161,7 @@ const options = defineCollection({ // ... schema: s.object({ // ... - link: z.string() as Schema> + link: s.string() as Schema> }) }) ``` diff --git a/docs/other/snippets.md b/docs/other/snippets.md index afc79b3e..35011bae 100644 --- a/docs/other/snippets.md +++ b/docs/other/snippets.md @@ -141,7 +141,7 @@ const compileMdx = async (source: string): Promise => { absWorkingDir: resolve('content'), write: false, bundle: true, - target: 'node18', + target: 'node22', platform: 'neutral', format: 'esm', globalName: 'VELITE_MDX_COMPONENT', diff --git a/docs/reference/api.md b/docs/reference/api.md index 7cb822d6..e77aae5a 100644 --- a/docs/reference/api.md +++ b/docs/reference/api.md @@ -48,6 +48,8 @@ Clean output directories before build. Watch files and rebuild on changes. +For programmatic watch mode, prefer [`watch()`](#watch) so you can close the returned watcher handle. `build({ watch: true })` preserves the historical build facade behavior and still returns only the initial build result. +