diff --git a/.gitignore b/.gitignore index 791a71595..00d765bbc 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ node_modules dist .contentlayer .eslintcache +.source # production /build diff --git a/examples/next-mdx/content/docs/index.mdx b/examples/next-mdx/content/docs/index.mdx index b8ee9c992..533ff8fe4 100644 --- a/examples/next-mdx/content/docs/index.mdx +++ b/examples/next-mdx/content/docs/index.mdx @@ -7,6 +7,11 @@ Hey there! ## Heading +sfd +asdfaasffsd +fsda +fsd + diff --git a/examples/next-mdx/package.json b/examples/next-mdx/package.json index ed689c8ea..c04f5f001 100644 --- a/examples/next-mdx/package.json +++ b/examples/next-mdx/package.json @@ -13,7 +13,8 @@ "fumadocs-ui": "workspace:*", "next": "^14.2.5", "react": "18.3.1", - "react-dom": "18.3.1" + "react-dom": "18.3.1", + "zod": "^3.23.8" }, "devDependencies": { "@types/mdx": "^2.0.13", diff --git a/examples/next-mdx/source.config.ts b/examples/next-mdx/source.config.ts new file mode 100644 index 000000000..207f96ee0 --- /dev/null +++ b/examples/next-mdx/source.config.ts @@ -0,0 +1,12 @@ +import { defineDocs, defineCollections } from 'fumadocs-mdx/config'; +import { z } from 'zod'; + +export const { docs, meta } = defineDocs(); + +export const blog = defineCollections({ + type: 'doc', + dir: './content/blog', + schema: z.object({ + title: z.string(), + }), +}); diff --git a/packages/mdx/package.json b/packages/mdx/package.json index c0a82ada2..d87ac2d2f 100644 --- a/packages/mdx/package.json +++ b/packages/mdx/package.json @@ -45,6 +45,7 @@ }, "dependencies": { "@mdx-js/mdx": "^3.0.1", + "@swc/core": "^1.7.18", "cross-spawn": "^7.0.3", "estree-util-value-to-estree": "^3.1.2", "fast-glob": "^3.3.1", diff --git a/packages/mdx/src/config.ts b/packages/mdx/src/config.ts index b974737d9..3b6e58201 100644 --- a/packages/mdx/src/config.ts +++ b/packages/mdx/src/config.ts @@ -1,210 +1,2 @@ -import path from 'node:path'; -import type { NextConfig } from 'next'; -import { - rehypeCode, - remarkGfm, - remarkStructure, - remarkHeading, - type RehypeCodeOptions, - remarkImage, - type RemarkImageOptions, - type RemarkHeadingOptions, -} from 'fumadocs-core/mdx-plugins'; -import type { Pluggable } from 'unified'; -import type { Configuration } from 'webpack'; -import { MapWebpackPlugin } from './webpack-plugins/map-plugin'; -import remarkMdxExport from './mdx-plugins/remark-exports'; -import type { LoaderOptions } from './loader'; -import type { Options as MDXLoaderOptions } from './loader-mdx'; -import { - SearchIndexPlugin, - type Options as SearchIndexPluginOptions, -} from './webpack-plugins/search-index-plugin'; - -type MDXOptions = Omit< - NonNullable, - 'rehypePlugins' | 'remarkPlugins' -> & { - rehypePlugins?: ResolvePlugins; - remarkPlugins?: ResolvePlugins; - - /** - * Properties to export from `vfile.data` - */ - valueToExport?: string[]; - - remarkHeadingOptions?: RemarkHeadingOptions; - remarkImageOptions?: RemarkImageOptions | false; - rehypeCodeOptions?: RehypeCodeOptions | false; -}; - -type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]); - -export interface CreateMDXOptions { - cwd?: string; - - mdxOptions?: MDXOptions; - - buildSearchIndex?: - | Omit - | boolean; - - /** - * Where the root map.ts should be, relative to cwd - * - * @defaultValue `'./.map.ts'` - */ - rootMapPath?: string; - - /** - * Where the content directory should be, relative to cwd - * - * @defaultValue `'./content'` - */ - rootContentPath?: string; - - /** - * {@link LoaderOptions.include} - */ - include?: string | string[]; -} - -function pluginOption( - def: (v: Pluggable[]) => (Pluggable | false)[], - options: ResolvePlugins = [], -): Pluggable[] { - const list = def(Array.isArray(options) ? options : []).filter( - Boolean, - ) as Pluggable[]; - - if (typeof options === 'function') { - return options(list); - } - - return list; -} - -function getMDXLoaderOptions({ - valueToExport = [], - rehypeCodeOptions, - remarkImageOptions, - remarkHeadingOptions, - ...mdxOptions -}: MDXOptions): MDXLoaderOptions { - const mdxExports = [ - 'structuredData', - 'toc', - 'frontmatter', - 'lastModified', - ...valueToExport, - ]; - - const remarkPlugins = pluginOption( - (v) => [ - remarkGfm, - [remarkHeading, remarkHeadingOptions], - remarkImageOptions !== false && [remarkImage, remarkImageOptions], - ...v, - remarkStructure, - [remarkMdxExport, { values: mdxExports }], - ], - mdxOptions.remarkPlugins, - ); - - const rehypePlugins = pluginOption( - (v) => [ - rehypeCodeOptions !== false && [rehypeCode, rehypeCodeOptions], - ...v, - ], - mdxOptions.rehypePlugins, - ); - - return { - providerImportSource: 'next-mdx-import-source-file', - ...mdxOptions, - remarkPlugins, - rehypePlugins, - }; -} - -const defaultPageExtensions = ['mdx', 'md', 'jsx', 'js', 'tsx', 'ts']; - -function createMDX({ - mdxOptions = {}, - cwd = process.cwd(), - rootMapPath = './.map.ts', - rootContentPath = './content', - buildSearchIndex = false, - ...loadOptions -}: CreateMDXOptions = {}) { - const rootMapFile = path.resolve(cwd, rootMapPath); - const rootContentDir = path.resolve(cwd, rootContentPath); - const mdxLoaderOptions = getMDXLoaderOptions(mdxOptions); - - return (nextConfig: NextConfig = {}): NextConfig => { - return { - ...nextConfig, - pageExtensions: nextConfig.pageExtensions ?? defaultPageExtensions, - webpack: (config: Configuration, options) => { - config.resolve ||= {}; - - const alias = config.resolve.alias as Record; - - alias['next-mdx-import-source-file'] = [ - 'private-next-root-dir/src/mdx-components', - 'private-next-root-dir/mdx-components', - '@mdx-js/react', - ]; - - config.module ||= {}; - config.module.rules ||= []; - - config.module.rules.push( - { - test: /\.mdx?$/, - use: [ - options.defaultLoaders.babel, - { - loader: 'fumadocs-mdx/loader-mdx', - options: mdxLoaderOptions, - }, - ], - }, - { - test: rootMapFile, - use: { - loader: 'fumadocs-mdx/loader', - options: { - rootContentDir, - rootMapFile, - ...loadOptions, - } satisfies LoaderOptions, - }, - }, - ); - - config.plugins ||= []; - - config.plugins.push( - new MapWebpackPlugin({ - rootMapFile, - }), - ); - - if (buildSearchIndex !== false) - config.plugins.push( - new SearchIndexPlugin({ - rootContentDir, - rootMapFile, - ...(typeof buildSearchIndex === 'object' ? buildSearchIndex : {}), - }), - ); - - // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- not provided - return nextConfig.webpack?.(config, options) ?? config; - }, - }; - }; -} - -export { createMDX as default }; +export * from './next/create'; +export * from './config/index'; diff --git a/packages/mdx/src/config/built-in.ts b/packages/mdx/src/config/built-in.ts new file mode 100644 index 000000000..f16cd0beb --- /dev/null +++ b/packages/mdx/src/config/built-in.ts @@ -0,0 +1,36 @@ +import { type AnyZodObject } from 'zod'; +import { + type CollectionData, + type Collections, + defineCollections, +} from '@/config/collections'; +import { frontmatterSchema, metaSchema } from '@/utils/schema'; + +export function defineDocs< + F extends AnyZodObject = typeof frontmatterSchema, + M extends AnyZodObject = typeof metaSchema, + DocsOut = CollectionData, + MetaOut = CollectionData, +>(options?: { + docs?: Partial>; + meta?: Partial>; +}): { + docs: Collections; + meta: Collections; +} { + return { + docs: defineCollections({ + type: 'doc', + dir: 'content/docs', + schema: frontmatterSchema as unknown as F, + ...options?.docs, + }), + meta: defineCollections({ + type: 'meta', + dir: 'content/docs', + files: ['**/*/meta.json'], + schema: metaSchema as M, + ...options?.meta, + }), + }; +} diff --git a/packages/mdx/src/config/collections.ts b/packages/mdx/src/config/collections.ts new file mode 100644 index 000000000..00bdbee5f --- /dev/null +++ b/packages/mdx/src/config/collections.ts @@ -0,0 +1,64 @@ +import { type AnyZodObject, type z } from 'zod'; +import type { TableOfContents } from 'fumadocs-core/server'; +import type { StructuredData } from 'fumadocs-core/mdx-plugins'; +import type { MDXProps } from 'mdx/types'; + +export interface MarkdownProps { + body: (props: MDXProps) => React.ReactElement; + structuredData: StructuredData; + toc: TableOfContents; +} + +export interface SupportedTypes { + meta: Record; + doc: MarkdownProps; +} + +export type SupportedType = keyof SupportedTypes; + +export type CollectionData< + Schema extends AnyZodObject, + Type extends SupportedType, +> = Omit> & z.output; + +export interface Collections< + Schema extends AnyZodObject = AnyZodObject, + Type extends SupportedType = SupportedType, + Output = CollectionData, +> { + /** + * Directories to scan + */ + dir: string | string[]; + + /** + * what files to include/exclude (glob patterns) + * + * Include all files if not specified + */ + files?: string[]; + + schema: Schema; + + /** + * content type + */ + type: Type; + + transform?: (entry: CollectionData) => Output; +} + +export function defineCollections< + Schema extends AnyZodObject, + Type extends SupportedType, + Output = CollectionData, +>( + options: Collections, +): { + _doc: 'collections'; +} & Collections { + return { + _doc: 'collections', + ...options, + }; +} diff --git a/packages/mdx/src/config/index.ts b/packages/mdx/src/config/index.ts new file mode 100644 index 000000000..379d00eb8 --- /dev/null +++ b/packages/mdx/src/config/index.ts @@ -0,0 +1,3 @@ +export * from './types'; +export * from './collections'; +export * from './built-in'; diff --git a/packages/mdx/src/config/types.ts b/packages/mdx/src/config/types.ts new file mode 100644 index 000000000..9537568af --- /dev/null +++ b/packages/mdx/src/config/types.ts @@ -0,0 +1,32 @@ +import { type AnyZodObject, type z } from 'zod'; +import { + type Collections, + type SupportedType, + type SupportedTypes, +} from '@/config/collections'; + +export type Config = Record; + +export type InferSchema = + C extends Collections ? Schema : never; + +export type InferSchemaType = z.output>; + +export type InferCollectionsProps = + SupportedTypes[C extends Collections + ? Type + : never]; + +export type CollectionEntry = + C extends Collections + ? Omit & { + _file: { + path: string; + }; + } + : never; + +/** + * Get output type of collections + */ +export type GetOutput = CollectionEntry[]; diff --git a/packages/mdx/src/loader.ts b/packages/mdx/src/loader.ts index 620aca903..aa55a0015 100644 --- a/packages/mdx/src/loader.ts +++ b/packages/mdx/src/loader.ts @@ -1,8 +1,11 @@ import path from 'node:path'; import fg from 'fast-glob'; import type { LoaderContext } from 'webpack'; +import { findConfigFile, loadConfig } from '@/utils/config'; export interface LoaderOptions { + configPath?: string; + rootContentDir: string; rootMapFile: string; @@ -17,32 +20,31 @@ export interface LoaderOptions { /** * Load the root `.map.ts` file */ -export default function loader( +export default async function loader( this: LoaderContext, _source: string, callback: LoaderContext['callback'], -): void { - const options = this.getOptions(); +): Promise { + const { + rootMapFile, + configPath = findConfigFile(), + include = ['./**/*.{md,mdx,json}'], + } = this.getOptions(); this.cacheable(true); - this.addContextDependency(options.rootContentDir); - - callback(null, buildMap(options)); -} + for (const v of ) + this.addContextDependency(rootContentDir); + this.addDependency(configPath); -function buildMap({ - rootContentDir, - rootMapFile, - include = ['./**/*.{md,mdx,json}'], -}: LoaderOptions): string { const mapDir = path.dirname(rootMapFile); - const files = fg.sync(include, { cwd: rootContentDir, }); const imports: string[] = []; const entries: string[] = []; + const config = await loadConfig(configPath); + config['sdf'] files.forEach((file, i) => { let importPath = path @@ -58,7 +60,10 @@ function buildMap({ entries.push(`${JSON.stringify(file)}: ${name}`); }); - return [imports.join('\n'), `export const map = {${entries.join(',')}}`].join( - '\n', + callback( + null, + [imports.join('\n'), `export const map = {${entries.join(',')}}`].join( + '\n', + ), ); } diff --git a/packages/mdx/src/next/create.ts b/packages/mdx/src/next/create.ts new file mode 100644 index 000000000..b89e08cb5 --- /dev/null +++ b/packages/mdx/src/next/create.ts @@ -0,0 +1,210 @@ +import path from 'node:path'; +import type { NextConfig } from 'next'; +import { + rehypeCode, + remarkGfm, + remarkStructure, + remarkHeading, + type RehypeCodeOptions, + remarkImage, + type RemarkImageOptions, + type RemarkHeadingOptions, +} from 'fumadocs-core/mdx-plugins'; +import type { Pluggable } from 'unified'; +import type { Configuration } from 'webpack'; +import { MapWebpackPlugin } from '@/webpack-plugins/map-plugin'; +import type { LoaderOptions } from '@/loader'; +import remarkMdxExport from '../mdx-plugins/remark-exports'; +import type { Options as MDXLoaderOptions } from '../loader-mdx'; +import { + SearchIndexPlugin, + type Options as SearchIndexPluginOptions, +} from '../webpack-plugins/search-index-plugin'; + +type MDXOptions = Omit< + NonNullable, + 'rehypePlugins' | 'remarkPlugins' +> & { + rehypePlugins?: ResolvePlugins; + remarkPlugins?: ResolvePlugins; + + /** + * Properties to export from `vfile.data` + */ + valueToExport?: string[]; + + remarkHeadingOptions?: RemarkHeadingOptions; + remarkImageOptions?: RemarkImageOptions | false; + rehypeCodeOptions?: RehypeCodeOptions | false; +}; + +type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]); + +export interface CreateMDXOptions { + cwd?: string; + + mdxOptions?: MDXOptions; + + buildSearchIndex?: + | Omit + | boolean; + + /** + * Where the root map.ts should be, relative to cwd + * + * @defaultValue `'./.map.ts'` + */ + rootMapPath?: string; + + /** + * Where the content directory should be, relative to cwd + * + * @defaultValue `'./content'` + */ + rootContentPath?: string; + + /** + * {@link LoaderOptions.include} + */ + include?: string | string[]; +} + +function pluginOption( + def: (v: Pluggable[]) => (Pluggable | false)[], + options: ResolvePlugins = [], +): Pluggable[] { + const list = def(Array.isArray(options) ? options : []).filter( + Boolean, + ) as Pluggable[]; + + if (typeof options === 'function') { + return options(list); + } + + return list; +} + +function getMDXLoaderOptions({ + valueToExport = [], + rehypeCodeOptions, + remarkImageOptions, + remarkHeadingOptions, + ...mdxOptions +}: MDXOptions): MDXLoaderOptions { + const mdxExports = [ + 'structuredData', + 'toc', + 'frontmatter', + 'lastModified', + ...valueToExport, + ]; + + const remarkPlugins = pluginOption( + (v) => [ + remarkGfm, + [remarkHeading, remarkHeadingOptions], + remarkImageOptions !== false && [remarkImage, remarkImageOptions], + ...v, + remarkStructure, + [remarkMdxExport, { values: mdxExports }], + ], + mdxOptions.remarkPlugins, + ); + + const rehypePlugins = pluginOption( + (v) => [ + rehypeCodeOptions !== false && [rehypeCode, rehypeCodeOptions], + ...v, + ], + mdxOptions.rehypePlugins, + ); + + return { + providerImportSource: 'next-mdx-import-source-file', + ...mdxOptions, + remarkPlugins, + rehypePlugins, + }; +} + +const defaultPageExtensions = ['mdx', 'md', 'jsx', 'js', 'tsx', 'ts']; + +function createMDX({ + mdxOptions = {}, + cwd = process.cwd(), + rootMapPath = './.map.ts', + rootContentPath = './content', + buildSearchIndex = false, + ...loadOptions +}: CreateMDXOptions = {}) { + const rootMapFile = path.resolve(cwd, rootMapPath); + const rootContentDir = path.resolve(cwd, rootContentPath); + const mdxLoaderOptions = getMDXLoaderOptions(mdxOptions); + + return (nextConfig: NextConfig = {}): NextConfig => { + return { + ...nextConfig, + pageExtensions: nextConfig.pageExtensions ?? defaultPageExtensions, + webpack: (config: Configuration, options) => { + config.resolve ||= {}; + + const alias = config.resolve.alias as Record; + + alias['next-mdx-import-source-file'] = [ + 'private-next-root-dir/src/mdx-components', + 'private-next-root-dir/mdx-components', + '@mdx-js/react', + ]; + + config.module ||= {}; + config.module.rules ||= []; + + config.module.rules.push( + { + test: /\.mdx?$/, + use: [ + options.defaultLoaders.babel, + { + loader: 'fumadocs-mdx/loader-mdx', + options: mdxLoaderOptions, + }, + ], + }, + { + test: rootMapFile, + use: { + loader: 'fumadocs-mdx/loader', + options: { + rootContentDir, + rootMapFile, + ...loadOptions, + } satisfies LoaderOptions, + }, + }, + ); + + config.plugins ||= []; + + config.plugins.push( + new MapWebpackPlugin({ + rootMapFile, + }), + ); + + if (buildSearchIndex !== false) + config.plugins.push( + new SearchIndexPlugin({ + rootContentDir, + rootMapFile, + ...(typeof buildSearchIndex === 'object' ? buildSearchIndex : {}), + }), + ); + + // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- not provided + return nextConfig.webpack?.(config, options) ?? config; + }, + }; + }; +} + +export { createMDX as default }; diff --git a/packages/mdx/src/utils/config.ts b/packages/mdx/src/utils/config.ts new file mode 100644 index 000000000..74cd6420b --- /dev/null +++ b/packages/mdx/src/utils/config.ts @@ -0,0 +1,78 @@ +import * as path from 'node:path'; +import { readFile, writeFile, mkdir } from 'node:fs/promises'; +import { join } from 'node:path'; +import { type CompilerOptions } from 'typescript'; +import { type Options as SWCOptions, transform } from '@swc/core'; +import { type Config } from '@/config/types'; + +export function findConfigFile(): string { + return path.resolve('source.config.ts'); +} + +export async function loadConfig(configPath: string): Promise { + const outputPath = path.resolve('.source/config.js'); + const configCode = await readFile(configPath).catch(() => null); + + if (!configCode) throw new Error('No configuration file found'); + + const transformed = await transform(configCode.toString(), { + ...resolveSWCOptions( + process.cwd(), + (await readTSConfig(process.cwd())).compilerOptions, + ), + outputPath, + }); + + await mkdir(path.dirname(outputPath), { recursive: true }); + await writeFile(outputPath, transformed.code); + + return ((await import(outputPath)) as { default: Config }).default; +} + +interface TSConfig { + compilerOptions: CompilerOptions; +} + +async function readTSConfig(cwd: string): Promise { + try { + const contents = await readFile(join(cwd, 'tsconfig.json'), 'utf8'); + + // Special case an empty file + if (contents.trim() === '') { + return { compilerOptions: {} }; + } + + return JSON.parse(contents) as TSConfig; + } catch (error) { + // ignore if tsconfig.json does not exist + if ((error as NodeJS.ErrnoException).code !== 'ENOENT') { + throw error; + } + + return { compilerOptions: {} }; + } +} + +function resolveSWCOptions( + cwd: string, + compilerOptions: CompilerOptions, +): SWCOptions { + const resolvedBaseUrl = path.join(cwd, compilerOptions.baseUrl ?? '.'); + + return { + configFile: false, + jsc: { + target: 'es5', + parser: { + syntax: 'typescript', + }, + paths: compilerOptions.paths, + baseUrl: resolvedBaseUrl, + }, + module: { + type: 'commonjs', + }, + sourceMaps: false, + isModule: 'unknown', + }; +} diff --git a/packages/mdx/src/utils/schema.ts b/packages/mdx/src/utils/schema.ts index 4eca0e0d8..108d2e9d9 100644 --- a/packages/mdx/src/utils/schema.ts +++ b/packages/mdx/src/utils/schema.ts @@ -1,6 +1,6 @@ import { z } from 'zod'; -const metaSchema = z.object({ +export const metaSchema = z.object({ title: z.string().optional(), pages: z.array(z.string()).optional(), root: z.boolean().optional(), @@ -8,7 +8,7 @@ const metaSchema = z.object({ icon: z.string().optional(), }); -const frontmatterSchema = z.object({ +export const frontmatterSchema = z.object({ title: z.string(), description: z.string().optional(), icon: z.string().optional(), diff --git a/packages/mdx/tsup.config.ts b/packages/mdx/tsup.config.ts index a010ecd31..49f591ccf 100644 --- a/packages/mdx/tsup.config.ts +++ b/packages/mdx/tsup.config.ts @@ -3,7 +3,7 @@ import { defineConfig } from 'tsup'; export default defineConfig({ entry: ['./src/{config,index,loader,loader-mdx}.ts'], format: 'esm', - external: ['fumadocs-core', 'webpack', 'next'], + external: ['fumadocs-core', 'webpack', 'next', 'typescript'], dts: true, target: 'node18', }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 718776d16..4bc70cfa5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,7 +37,7 @@ importers: version: 6.0.1 tsup: specifier: 8.2.4 - version: 8.2.4(@swc/core@1.7.11)(jiti@1.21.6)(postcss@8.4.41)(tsx@4.17.0)(typescript@5.5.4)(yaml@2.5.0) + version: 8.2.4(@swc/core@1.7.18)(jiti@1.21.6)(postcss@8.4.41)(tsx@4.17.0)(typescript@5.5.4)(yaml@2.5.0) turbo: specifier: 2.0.14 version: 2.0.14 @@ -179,7 +179,7 @@ importers: version: 5.5.4 webpack: specifier: ^5.90.3 - version: 5.90.3(@swc/core@1.7.11)(esbuild@0.23.0) + version: 5.90.3(@swc/core@1.7.18)(esbuild@0.23.0) examples/content-collections: dependencies: @@ -278,6 +278,9 @@ importers: react-dom: specifier: 18.3.1 version: 18.3.1(react@18.3.1) + zod: + specifier: ^3.23.8 + version: 3.23.8 devDependencies: '@types/mdx': specifier: ^2.0.13 @@ -631,6 +634,9 @@ importers: '@mdx-js/mdx': specifier: ^3.0.1 version: 3.0.1 + '@swc/core': + specifier: ^1.7.18 + version: 1.7.18(@swc/helpers@0.5.12) cross-spawn: specifier: ^7.0.3 version: 7.0.3 @@ -676,7 +682,7 @@ importers: version: 11.0.5 webpack: specifier: ^5.90.3 - version: 5.90.3(@swc/core@1.7.11)(esbuild@0.23.0) + version: 5.90.3(@swc/core@1.7.18(@swc/helpers@0.5.12))(esbuild@0.23.0) packages/mdx-remote: dependencies: @@ -2816,22 +2822,16 @@ packages: resolution: {integrity: sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw==} engines: {node: '>=18'} - '@swc/core-darwin-arm64@1.7.10': - resolution: {integrity: sha512-TYp4x/9w/C/yMU1olK5hTKq/Hi7BjG71UJ4V1U1WxI1JA3uokjQ/GoktDfmH5V5pX4dgGSOJwUe2RjoN8Z/XnA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [darwin] - '@swc/core-darwin-arm64@1.7.11': resolution: {integrity: sha512-HRQv4qIeMBPThZ6Y/4yYW52rGsS6yrpusvuxLGyoFo45Y0y12/V2yXkOIA/0HIQyrqoUAxn1k4zQXpPaPNCmnw==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.7.10': - resolution: {integrity: sha512-P3LJjAWh5yLc6p5IUwV5LgRfA3R1oDCZDMabYyb2BVQuJTD4MfegW9DhBcUUF5dhBLwq3191KpLVzE+dLTbiXw==} + '@swc/core-darwin-arm64@1.7.18': + resolution: {integrity: sha512-MwLc5U+VGPMZm8MjlFBjEB2wyT1EK0NNJ3tn+ps9fmxdFP+PL8EpMiY1O1F2t1ydy2OzBtZz81sycjM9RieFBg==} engines: {node: '>=10'} - cpu: [x64] + cpu: [arm64] os: [darwin] '@swc/core-darwin-x64@1.7.11': @@ -2840,11 +2840,11 @@ packages: cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.7.10': - resolution: {integrity: sha512-yGOFjE7w/akRTmqGY3FvWYrqbxO7OB2N2FHj2LO5HtzXflfoABb5RyRvdEquX+17J6mEpu4EwjYNraTD/WHIEQ==} + '@swc/core-darwin-x64@1.7.18': + resolution: {integrity: sha512-IkukOQUw7/14VkHp446OkYGCZEHqZg9pTmTdBawlUyz2JwZMSn2VodCl7aFSdGCsU4Cwni8zKA8CCgkCCAELhw==} engines: {node: '>=10'} - cpu: [arm] - os: [linux] + cpu: [x64] + os: [darwin] '@swc/core-linux-arm-gnueabihf@1.7.11': resolution: {integrity: sha512-mHtzWKxhtyreI4CSxs+3+ENv8t/Qo35WFoYG66qHEgJz/Z2Lh6jv1E+MYgHdYwnpQHgHbdvAco7HsBu/Dt6xXw==} @@ -2852,10 +2852,10 @@ packages: cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.7.10': - resolution: {integrity: sha512-SPWsgWHfdWKKjLrYlvhxcdBJ7Ruy6crJbPoE9NfD95eJEjMnS2yZTqj2ChFsY737WeyhWYlHzgYhYOVCp83YwQ==} + '@swc/core-linux-arm-gnueabihf@1.7.18': + resolution: {integrity: sha512-ATnb6jJaBeXCqrTUawWdoOy7eP9SCI7UMcfXlYIMxX4otKKspLPAEuGA5RaNxlCcj9ObyO0J3YGbtZ6hhD2pjg==} engines: {node: '>=10'} - cpu: [arm64] + cpu: [arm] os: [linux] '@swc/core-linux-arm64-gnu@1.7.11': @@ -2864,8 +2864,8 @@ packages: cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.7.10': - resolution: {integrity: sha512-PUi50bkNqnBL3Z/Zq6jSfwgN9A/taA6u2Zou0tjDJi7oVdpjdr7SxNgCGzMJ/nNg5D/IQn1opM1jktMvpsPAuQ==} + '@swc/core-linux-arm64-gnu@1.7.18': + resolution: {integrity: sha512-poHtH7zL7lEp9K2inY90lGHJABWxURAOgWNeZqrcR5+jwIe7q5KBisysH09Zf/JNF9+6iNns+U0xgWTNJzBuGA==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -2876,10 +2876,10 @@ packages: cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.7.10': - resolution: {integrity: sha512-Sc+pY55gknCAmBQBR6DhlA7jZSxHaLSDb5Sevzi6DOFMXR79NpA6zWTNKwp1GK2AnRIkbAfvYLgOxS5uWTFVpg==} + '@swc/core-linux-arm64-musl@1.7.18': + resolution: {integrity: sha512-qnNI1WmcOV7Wz1ZDyK6WrOlzLvJ01rnni8ec950mMHWkLRMP53QvCvhF3S+7gFplWBwWJTOOPPUqJp/PlSxWyQ==} engines: {node: '>=10'} - cpu: [x64] + cpu: [arm64] os: [linux] '@swc/core-linux-x64-gnu@1.7.11': @@ -2888,8 +2888,8 @@ packages: cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.7.10': - resolution: {integrity: sha512-g5NKx2LXaGd0K26hmEts1Cvb7ptIvq3MHSgr6/D1tRPcDZw1Sp0dYsmyOv0ho4F5GOJyiCooG3oE9FXdb7jIpQ==} + '@swc/core-linux-x64-gnu@1.7.18': + resolution: {integrity: sha512-x9SCqCLzwtlqtD5At3I1a7Gco+EuXnzrJGoucmkpeQohshHuwa+cskqsXO6u1Dz0jXJEuHbBZB9va1wYYfjgFg==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -2900,11 +2900,11 @@ packages: cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.7.10': - resolution: {integrity: sha512-plRIsOcfy9t9Q/ivm5DA7I0HaIvfAWPbI+bvVRrr3C/1K2CSqnqZJjEWOAmx2LiyipijNnEaFYuLBp0IkGuJpg==} + '@swc/core-linux-x64-musl@1.7.18': + resolution: {integrity: sha512-qtj8iOpMMgKjzxTv+islmEY0JBsbd93nka0gzcTTmGZxKtL5jSUsYQvkxwNPZr5M9NU1fgaR3n1vE6lFmtY0IQ==} engines: {node: '>=10'} - cpu: [arm64] - os: [win32] + cpu: [x64] + os: [linux] '@swc/core-win32-arm64-msvc@1.7.11': resolution: {integrity: sha512-a2Y4xxEsLLYHJN7sMnw9+YQJDi3M1BxEr9hklfopPuGGnYLFNnx5CypH1l9ReijEfWjIAHNi7pq3m023lzW1Hg==} @@ -2912,10 +2912,10 @@ packages: cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.7.10': - resolution: {integrity: sha512-GntrVNT23viHtbfzmlK8lfBiKeajH24GzbDT7qXhnoO20suUPcyYZxyvCb4gWM2zu8ZBTPHNlqfrNsriQCZ+lQ==} + '@swc/core-win32-arm64-msvc@1.7.18': + resolution: {integrity: sha512-ltX/Ol9+Qu4SXmISCeuwVgAjSa8nzHTymknpozzVMgjXUoZMoz6lcynfKL1nCh5XLgqh0XNHUKLti5YFF8LrrA==} engines: {node: '>=10'} - cpu: [ia32] + cpu: [arm64] os: [win32] '@swc/core-win32-ia32-msvc@1.7.11': @@ -2924,10 +2924,10 @@ packages: cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.7.10': - resolution: {integrity: sha512-uXIF8GuSappe1imm6Lf7pHGepfCBjDQlS+qTqvEGE0wZAsL1IVATK9P/cH/OCLfJXeQDTLeSYmrpwjtXNt46tQ==} + '@swc/core-win32-ia32-msvc@1.7.18': + resolution: {integrity: sha512-RgTcFP3wgyxnQbTCJrlgBJmgpeTXo8t807GU9GxApAXfpLZJ3swJ2GgFUmIJVdLWyffSHF5BEkF3FmF6mtH5AQ==} engines: {node: '>=10'} - cpu: [x64] + cpu: [ia32] os: [win32] '@swc/core-win32-x64-msvc@1.7.11': @@ -2936,8 +2936,14 @@ packages: cpu: [x64] os: [win32] - '@swc/core@1.7.10': - resolution: {integrity: sha512-l0xrFwBQ9atizhmV94yC2nwcecTk/oftofwMNPiFMGe56dqdmi2ArHaTV3PCtMlgaUH6rGCehoRMt5OrCI1ktg==} + '@swc/core-win32-x64-msvc@1.7.18': + resolution: {integrity: sha512-XbZ0wAgzR757+DhQcnv60Y/bK9yuWPhDNRQVFFQVRsowvK3+c6EblyfUSytIidpXgyYFzlprq/9A9ZlO/wvDWw==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + + '@swc/core@1.7.11': + resolution: {integrity: sha512-AB+qc45UrJrDfbhPKcUXk+9z/NmFfYYwJT6G7/iur0fCse9kXjx45gi40+u/O2zgarG/30/zV6E3ps8fUvjh7g==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -2945,8 +2951,8 @@ packages: '@swc/helpers': optional: true - '@swc/core@1.7.11': - resolution: {integrity: sha512-AB+qc45UrJrDfbhPKcUXk+9z/NmFfYYwJT6G7/iur0fCse9kXjx45gi40+u/O2zgarG/30/zV6E3ps8fUvjh7g==} + '@swc/core@1.7.18': + resolution: {integrity: sha512-qL9v5N5S38ijmqiQRvCFUUx2vmxWT/JJ2rswElnyaHkOHuVoAFhBB90Ywj4RKjh3R0zOjhEcemENTyF3q3G6WQ==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -8719,84 +8725,67 @@ snapshots: '@sindresorhus/merge-streams@1.0.0': {} - '@swc/core-darwin-arm64@1.7.10': - optional: true - '@swc/core-darwin-arm64@1.7.11': optional: true - '@swc/core-darwin-x64@1.7.10': + '@swc/core-darwin-arm64@1.7.18': optional: true '@swc/core-darwin-x64@1.7.11': optional: true - '@swc/core-linux-arm-gnueabihf@1.7.10': + '@swc/core-darwin-x64@1.7.18': optional: true '@swc/core-linux-arm-gnueabihf@1.7.11': optional: true - '@swc/core-linux-arm64-gnu@1.7.10': + '@swc/core-linux-arm-gnueabihf@1.7.18': optional: true '@swc/core-linux-arm64-gnu@1.7.11': optional: true - '@swc/core-linux-arm64-musl@1.7.10': + '@swc/core-linux-arm64-gnu@1.7.18': optional: true '@swc/core-linux-arm64-musl@1.7.11': optional: true - '@swc/core-linux-x64-gnu@1.7.10': + '@swc/core-linux-arm64-musl@1.7.18': optional: true '@swc/core-linux-x64-gnu@1.7.11': optional: true - '@swc/core-linux-x64-musl@1.7.10': + '@swc/core-linux-x64-gnu@1.7.18': optional: true '@swc/core-linux-x64-musl@1.7.11': optional: true - '@swc/core-win32-arm64-msvc@1.7.10': + '@swc/core-linux-x64-musl@1.7.18': optional: true '@swc/core-win32-arm64-msvc@1.7.11': optional: true - '@swc/core-win32-ia32-msvc@1.7.10': + '@swc/core-win32-arm64-msvc@1.7.18': optional: true '@swc/core-win32-ia32-msvc@1.7.11': optional: true - '@swc/core-win32-x64-msvc@1.7.10': + '@swc/core-win32-ia32-msvc@1.7.18': optional: true '@swc/core-win32-x64-msvc@1.7.11': optional: true - '@swc/core@1.7.10(@swc/helpers@0.5.12)': - dependencies: - '@swc/counter': 0.1.3 - '@swc/types': 0.1.12 - optionalDependencies: - '@swc/core-darwin-arm64': 1.7.10 - '@swc/core-darwin-x64': 1.7.10 - '@swc/core-linux-arm-gnueabihf': 1.7.10 - '@swc/core-linux-arm64-gnu': 1.7.10 - '@swc/core-linux-arm64-musl': 1.7.10 - '@swc/core-linux-x64-gnu': 1.7.10 - '@swc/core-linux-x64-musl': 1.7.10 - '@swc/core-win32-arm64-msvc': 1.7.10 - '@swc/core-win32-ia32-msvc': 1.7.10 - '@swc/core-win32-x64-msvc': 1.7.10 - '@swc/helpers': 0.5.12 + '@swc/core-win32-x64-msvc@1.7.18': + optional: true - '@swc/core@1.7.11': + '@swc/core@1.7.11(@swc/helpers@0.5.12)': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.12 @@ -8811,7 +8800,24 @@ snapshots: '@swc/core-win32-arm64-msvc': 1.7.11 '@swc/core-win32-ia32-msvc': 1.7.11 '@swc/core-win32-x64-msvc': 1.7.11 - optional: true + '@swc/helpers': 0.5.12 + + '@swc/core@1.7.18(@swc/helpers@0.5.12)': + dependencies: + '@swc/counter': 0.1.3 + '@swc/types': 0.1.12 + optionalDependencies: + '@swc/core-darwin-arm64': 1.7.18 + '@swc/core-darwin-x64': 1.7.18 + '@swc/core-linux-arm-gnueabihf': 1.7.18 + '@swc/core-linux-arm64-gnu': 1.7.18 + '@swc/core-linux-arm64-musl': 1.7.18 + '@swc/core-linux-x64-gnu': 1.7.18 + '@swc/core-linux-x64-musl': 1.7.18 + '@swc/core-win32-arm64-msvc': 1.7.18 + '@swc/core-win32-ia32-msvc': 1.7.18 + '@swc/core-win32-x64-msvc': 1.7.18 + '@swc/helpers': 0.5.12 '@swc/counter@0.1.3': {} @@ -9575,7 +9581,7 @@ snapshots: '@rollup/plugin-replace': 5.0.7(rollup@4.20.0) '@rollup/plugin-wasm': 6.2.2(rollup@4.20.0) '@rollup/pluginutils': 5.1.0(rollup@4.20.0) - '@swc/core': 1.7.10(@swc/helpers@0.5.12) + '@swc/core': 1.7.11(@swc/helpers@0.5.12) '@swc/helpers': 0.5.12 arg: 5.0.2 clean-css: 5.3.3 @@ -9584,7 +9590,7 @@ snapshots: pretty-bytes: 5.6.0 rollup: 4.20.0 rollup-plugin-dts: 6.1.1(rollup@4.20.0)(typescript@5.5.4) - rollup-plugin-swc3: 0.11.2(@swc/core@1.7.10(@swc/helpers@0.5.12))(rollup@4.20.0) + rollup-plugin-swc3: 0.11.2(@swc/core@1.7.11(@swc/helpers@0.5.12))(rollup@4.20.0) rollup-preserve-directives: 1.1.1(rollup@4.20.0) tslib: 2.6.3 optionalDependencies: @@ -10165,7 +10171,7 @@ snapshots: debug: 4.3.5 enhanced-resolve: 5.15.0 eslint: 8.57.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@8.1.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 @@ -10177,12 +10183,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0) transitivePeerDependencies: - supports-color @@ -12749,11 +12756,11 @@ snapshots: optionalDependencies: '@babel/code-frame': 7.24.7 - rollup-plugin-swc3@0.11.2(@swc/core@1.7.10(@swc/helpers@0.5.12))(rollup@4.20.0): + rollup-plugin-swc3@0.11.2(@swc/core@1.7.11(@swc/helpers@0.5.12))(rollup@4.20.0): dependencies: '@fastify/deepmerge': 1.3.0 '@rollup/pluginutils': 5.1.0(rollup@4.20.0) - '@swc/core': 1.7.10(@swc/helpers@0.5.12) + '@swc/core': 1.7.11(@swc/helpers@0.5.12) get-tsconfig: 4.7.6 rollup: 4.20.0 rollup-preserve-directives: 1.1.1(rollup@4.20.0) @@ -13178,16 +13185,28 @@ snapshots: term-size@2.2.1: {} - terser-webpack-plugin@5.3.10(@swc/core@1.7.11)(esbuild@0.23.0)(webpack@5.90.3(@swc/core@1.7.11)(esbuild@0.23.0)): + terser-webpack-plugin@5.3.10(@swc/core@1.7.18(@swc/helpers@0.5.12))(esbuild@0.23.0)(webpack@5.90.3(@swc/core@1.7.18(@swc/helpers@0.5.12))(esbuild@0.23.0)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.90.3(@swc/core@1.7.11)(esbuild@0.23.0) + webpack: 5.90.3(@swc/core@1.7.18(@swc/helpers@0.5.12))(esbuild@0.23.0) optionalDependencies: - '@swc/core': 1.7.11 + '@swc/core': 1.7.18(@swc/helpers@0.5.12) + esbuild: 0.23.0 + + terser-webpack-plugin@5.3.10(@swc/core@1.7.18)(esbuild@0.23.0)(webpack@5.90.3(@swc/core@1.7.18)(esbuild@0.23.0)): + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.2 + terser: 5.31.1 + webpack: 5.90.3(@swc/core@1.7.18)(esbuild@0.23.0) + optionalDependencies: + '@swc/core': 1.7.18(@swc/helpers@0.5.12) esbuild: 0.23.0 terser@5.31.1: @@ -13283,7 +13302,7 @@ snapshots: tslib@2.6.3: {} - tsup@8.2.4(@swc/core@1.7.11)(jiti@1.21.6)(postcss@8.4.41)(tsx@4.17.0)(typescript@5.5.4)(yaml@2.5.0): + tsup@8.2.4(@swc/core@1.7.18)(jiti@1.21.6)(postcss@8.4.41)(tsx@4.17.0)(typescript@5.5.4)(yaml@2.5.0): dependencies: bundle-require: 5.0.0(esbuild@0.23.0) cac: 6.7.14 @@ -13302,7 +13321,7 @@ snapshots: sucrase: 3.35.0 tree-kill: 1.2.2 optionalDependencies: - '@swc/core': 1.7.11 + '@swc/core': 1.7.18(@swc/helpers@0.5.12) postcss: 8.4.41 typescript: 5.5.4 transitivePeerDependencies: @@ -13641,7 +13660,38 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.90.3(@swc/core@1.7.11)(esbuild@0.23.0): + webpack@5.90.3(@swc/core@1.7.18(@swc/helpers@0.5.12))(esbuild@0.23.0): + dependencies: + '@types/eslint-scope': 3.7.6 + '@types/estree': 1.0.5 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/wasm-edit': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 + acorn: 8.11.3 + acorn-import-assertions: 1.9.0(acorn@8.11.3) + browserslist: 4.23.0 + chrome-trace-event: 1.0.3 + enhanced-resolve: 5.15.0 + es-module-lexer: 1.3.1 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.10(@swc/core@1.7.18(@swc/helpers@0.5.12))(esbuild@0.23.0)(webpack@5.90.3(@swc/core@1.7.18(@swc/helpers@0.5.12))(esbuild@0.23.0)) + watchpack: 2.4.0 + webpack-sources: 3.2.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + + webpack@5.90.3(@swc/core@1.7.18)(esbuild@0.23.0): dependencies: '@types/eslint-scope': 3.7.6 '@types/estree': 1.0.5 @@ -13664,7 +13714,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.7.11)(esbuild@0.23.0)(webpack@5.90.3(@swc/core@1.7.11)(esbuild@0.23.0)) + terser-webpack-plugin: 5.3.10(@swc/core@1.7.18)(esbuild@0.23.0)(webpack@5.90.3(@swc/core@1.7.18)(esbuild@0.23.0)) watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: