From d9079fd9a5b45bdf34102b068bddc5106158a02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20L=C3=A1z=C3=A1r?= Date: Mon, 6 Oct 2025 22:17:09 +0200 Subject: [PATCH 1/3] fix: module resolution --- examples/react-syntax-highlighter/App.jsx | 27 + examples/react-syntax-highlighter/Code.jsx | 15 + .../react-syntax-highlighter/package.json | 17 + packages/react-server/bin/cli.mjs | 4 +- packages/react-server/bin/commands/build.mjs | 1 + packages/react-server/bin/commands/dev.mjs | 1 + .../react-server/client/error-overlay.mjs | 2 +- packages/react-server/client/highlight.mjs | 10 +- packages/react-server/lib/build/server.mjs | 15 +- .../react-server/lib/dev/create-server.mjs | 38 +- .../react-server/lib/dev/render-stream.mjs | 2 - .../react-server/lib/loader/module-alias.mjs | 8 + .../react-server/lib/loader/node-loader.mjs | 25 +- .../lib/loader/node-loader.react-server.mjs | 36 +- .../lib/plugins/optimize-deps.mjs | 19 +- .../lib/plugins/resolve-workspace.mjs | 25 +- packages/react-server/lib/utils/check.mjs | 20 +- packages/react-server/lib/utils/module.mjs | 49 ++ packages/react-server/package.json | 1 + packages/react-server/server/GlobalError.jsx | 5 +- pnpm-lock.yaml | 561 +++++++++++++++--- .../apps/react-syntax-highlighter.spec.mjs | 32 + test/vitestSetup.mjs | 43 +- 23 files changed, 814 insertions(+), 142 deletions(-) create mode 100644 examples/react-syntax-highlighter/App.jsx create mode 100644 examples/react-syntax-highlighter/Code.jsx create mode 100644 examples/react-syntax-highlighter/package.json create mode 100644 test/__test__/apps/react-syntax-highlighter.spec.mjs diff --git a/examples/react-syntax-highlighter/App.jsx b/examples/react-syntax-highlighter/App.jsx new file mode 100644 index 00000000..df151166 --- /dev/null +++ b/examples/react-syntax-highlighter/App.jsx @@ -0,0 +1,27 @@ +import ClientCode from "./Code.jsx"; + +import { Light as SyntaxHighlighter } from "react-syntax-highlighter"; +import js from "react-syntax-highlighter/dist/esm/languages/hljs/javascript"; +import { vs } from "react-syntax-highlighter/dist/esm/styles/hljs"; + +SyntaxHighlighter.registerLanguage("javascript", js); + +function Code() { + return ( + + {`import { createServer } from 'react-server';`} + + ); +} + +export default function App() { + return ( + + +

react-syntax-highlighter

+ + + + + ); +} diff --git a/examples/react-syntax-highlighter/Code.jsx b/examples/react-syntax-highlighter/Code.jsx new file mode 100644 index 00000000..080c64ca --- /dev/null +++ b/examples/react-syntax-highlighter/Code.jsx @@ -0,0 +1,15 @@ +"use client"; + +import { Light as SyntaxHighlighter } from "react-syntax-highlighter"; +import js from "react-syntax-highlighter/dist/esm/languages/hljs/javascript"; +import { dark } from "react-syntax-highlighter/dist/esm/styles/hljs"; + +SyntaxHighlighter.registerLanguage("javascript", js); + +export default function ClientCode() { + return ( + + {`import { Link } from '@lazarv/react-server/navigation';`} + + ); +} diff --git a/examples/react-syntax-highlighter/package.json b/examples/react-syntax-highlighter/package.json new file mode 100644 index 00000000..d343950f --- /dev/null +++ b/examples/react-syntax-highlighter/package.json @@ -0,0 +1,17 @@ +{ + "name": "@lazarv/react-server-example-react-syntax-highlighter", + "private": true, + "description": "@lazarv/react-server React Syntax Highlighter example application", + "scripts": { + "dev": "react-server ./App.jsx", + "build": "react-server build ./App.jsx", + "start": "react-server start" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@lazarv/react-server": "workspace:^", + "react-syntax-highlighter": "^15.6.6" + } +} diff --git a/packages/react-server/bin/cli.mjs b/packages/react-server/bin/cli.mjs index 8a54c5bc..48555a59 100755 --- a/packages/react-server/bin/cli.mjs +++ b/packages/react-server/bin/cli.mjs @@ -40,7 +40,7 @@ try { // Check Node.js version if (cli.matchedCommand.__react_server_check_node_version__ !== false) { - if (checkJSRuntimeVersion()) { + if (cli.options.check !== false && checkJSRuntimeVersion()) { exit(1); } } @@ -62,7 +62,7 @@ try { cli.matchedCommand && cli.matchedCommand.__react_server_check_deps__ !== false ) { - if (await checkReactDependencies()) { + if (cli.options.check !== false && (await checkReactDependencies())) { exit(1); } } diff --git a/packages/react-server/bin/commands/build.mjs b/packages/react-server/bin/commands/build.mjs index 40020055..60d6c78f 100644 --- a/packages/react-server/bin/commands/build.mjs +++ b/packages/react-server/bin/commands/build.mjs @@ -12,6 +12,7 @@ export default (cli) => } ) .option("--no-color", "disable color output", { default: false }) + .option("--no-check", "skip dependency checks", { default: false }) .option("--server", "[boolean] build server", { default: true }) .option("--client", "[boolean] build client", { default: true }) .option("--export", "[boolean] static export") diff --git a/packages/react-server/bin/commands/dev.mjs b/packages/react-server/bin/commands/dev.mjs index 87eeed9f..9b7aa715 100644 --- a/packages/react-server/bin/commands/dev.mjs +++ b/packages/react-server/bin/commands/dev.mjs @@ -20,6 +20,7 @@ export default (cli) => default: false, }) .option("--no-color", "disable color output", { default: false }) + .option("--no-check", "skip dependency checks", { default: false }) .option("-e, --eval ", "evaluate code", { type: "string" }) .option("-o, --outDir ", "[string] output directory", { default: ".react-server", diff --git a/packages/react-server/client/error-overlay.mjs b/packages/react-server/client/error-overlay.mjs index 294bfd4d..a2a39cb2 100644 --- a/packages/react-server/client/error-overlay.mjs +++ b/packages/react-server/client/error-overlay.mjs @@ -214,7 +214,7 @@ export const showErrorOverlay = async (error, source, force, type, args) => { const link = document.createElement("link"); link.rel = "stylesheet"; const { default: href } = await import( - "highlight.js/styles/github-dark.css?url" + "react-server-highlight.js/styles/github-dark.css?url" ); link.href = href; overlay.shadowRoot.appendChild(link); diff --git a/packages/react-server/client/highlight.mjs b/packages/react-server/client/highlight.mjs index 704f2349..3fbe5e4b 100644 --- a/packages/react-server/client/highlight.mjs +++ b/packages/react-server/client/highlight.mjs @@ -1,8 +1,8 @@ -import hljs from "highlight.js/lib/core"; -import diff from "highlight.js/lib/languages/diff"; -import javascript from "highlight.js/lib/languages/javascript"; -import json from "highlight.js/lib/languages/json"; -import xml from "highlight.js/lib/languages/xml"; +import hljs from "react-server-highlight.js/lib/core"; +import diff from "react-server-highlight.js/lib/languages/diff"; +import javascript from "react-server-highlight.js/lib/languages/javascript"; +import json from "react-server-highlight.js/lib/languages/json"; +import xml from "react-server-highlight.js/lib/languages/xml"; hljs.registerLanguage("diff", diff); hljs.registerLanguage("javascript", javascript); diff --git a/packages/react-server/lib/build/server.mjs b/packages/react-server/lib/build/server.mjs index 89db4407..2e0ae4bc 100644 --- a/packages/react-server/lib/build/server.mjs +++ b/packages/react-server/lib/build/server.mjs @@ -28,7 +28,12 @@ import { } from "../utils/plugins.mjs"; import banner from "./banner.mjs"; import customLogger from "./custom-logger.mjs"; -import { bareImportRE, findNearestPackageData } from "../utils/module.mjs"; +import { + bareImportRE, + findNearestPackageData, + isSubpathExported, + nodeResolve, +} from "../utils/module.mjs"; import { realpathSync } from "node:fs"; const __require = createRequire(import.meta.url); @@ -70,6 +75,7 @@ export default async function serverBuild(root, options) { "picocolors", "unstorage", /^unstorage\/drivers\//, + /^react-server-highlight\.js/, ...(Array.isArray(config.build?.rollupOptions?.external) ? config.build?.rollupOptions?.external : []), @@ -95,14 +101,14 @@ export default async function serverBuild(root, options) { } return false; }; - const rscExternal = (id) => { + const rscExternal = (id, importer) => { if (isBuiltin(id)) { return true; } if (bareImportRE.test(id)) { try { - const mod = __require.resolve(id, { paths: [cwd] }); + const mod = nodeResolve(id, realpathSync(importer)); let pkg = findNearestPackageData(mod); const prev = pkg; if (pkg) { @@ -121,7 +127,8 @@ export default async function serverBuild(root, options) { if ( /[cm]?js$/.test(mod) && !(pkg?.type === "module" || pkg?.module || pkg?.exports) && - ![...(config.ssr?.noExternal ?? [])].includes(id) + ![...(config.ssr?.noExternal ?? [])].includes(id) && + isSubpathExported(pkg, id) ) { return true; } diff --git a/packages/react-server/lib/dev/create-server.mjs b/packages/react-server/lib/dev/create-server.mjs index 5fbfb89a..a4171345 100644 --- a/packages/react-server/lib/dev/create-server.mjs +++ b/packages/react-server/lib/dev/create-server.mjs @@ -53,7 +53,7 @@ import * as sys from "../sys.mjs"; import { makeResolveAlias } from "../utils/config.mjs"; import { replaceError } from "../utils/error.mjs"; import merge from "../utils/merge.mjs"; -import { findPackageRoot, tryStat } from "../utils/module.mjs"; +import { findPackageRoot, nodeResolve, tryStat } from "../utils/module.mjs"; import { filterOutVitePluginReact, userOrBuiltInVitePluginReact, @@ -147,11 +147,11 @@ export default async function createServer(root, options) { "react-server-dom-webpack/server.browser", "react-is", "@jridgewell/trace-mapping", - "highlight.js/lib/core", - "highlight.js/lib/languages/diff", - "highlight.js/lib/languages/javascript", - "highlight.js/lib/languages/json", - "highlight.js/lib/languages/xml", + "react-server-highlight.js/lib/core", + "react-server-highlight.js/lib/languages/diff", + "react-server-highlight.js/lib/languages/javascript", + "react-server-highlight.js/lib/languages/json", + "react-server-highlight.js/lib/languages/xml", "socket.io-client", "web-streams-polyfill/polyfill", ...(config.optimizeDeps?.include ?? []), @@ -190,19 +190,26 @@ export default async function createServer(root, options) { alias: [ ...resolvedClientAlias, { - find: /^highlight\.js\/lib/, + find: /^react-server-highlight\.js\/lib/, replacement: sys.normalizePath( dirname(__require.resolve("highlight.js/lib/core")) ), }, + { + find: /^react-server-highlight\.js\/styles/, + replacement: sys.normalizePath( + dirname(__require.resolve("highlight.js/lib/core")).replace( + "/lib", + "/styles" + ) + ), + }, { find: /^@jridgewell\/trace-mapping$/, replacement: sys.normalizePath( - typeof import.meta.resolve === "function" - ? import.meta.resolve("@jridgewell/trace-mapping") - : __require - .resolve("@jridgewell/trace-mapping") - .replace(/\.umd\.js$/, ".mjs") + __require + .resolve("@jridgewell/trace-mapping") + .replace(/\.umd\.js$/, ".mjs") ), }, { find: /^@lazarv\/react-server$/, replacement: sys.rootDir }, @@ -342,7 +349,7 @@ export default async function createServer(root, options) { "picocolors", "unstorage", "@modelcontextprotocol/sdk", - "highlight.js", + "react-server-highlight.js", ], alias: [ { @@ -512,8 +519,7 @@ export default async function createServer(root, options) { } catch { return { result: { - externalize: specifier, - type: "module", + externalize: nodeResolve(specifier, parentId), }, }; } @@ -561,7 +567,7 @@ export default async function createServer(root, options) { } = payload.data.data; let result = { - externalize: specifier, + externalize: nodeResolve(specifier, parentId), }; if (!isBuiltin(specifier)) { diff --git a/packages/react-server/lib/dev/render-stream.mjs b/packages/react-server/lib/dev/render-stream.mjs index d547da73..38e87c1e 100644 --- a/packages/react-server/lib/dev/render-stream.mjs +++ b/packages/react-server/lib/dev/render-stream.mjs @@ -45,7 +45,6 @@ Object.keys(console).forEach((method) => { import("react-server-dom-webpack/server.browser").then( ({ renderToReadableStream }) => { delete React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - const cwd = process.cwd(); const normalizedArgs = args.map((arg) => { if (arg instanceof Error) { const stacklines = arg.stack @@ -54,7 +53,6 @@ Object.keys(console).forEach((method) => { .map((it) => it .trim() - .replace(location.origin, it.includes(cwd) ? "" : cwd) .replace("/@fs", "") .replace(/\?v=[a-z0-9]+/, "") ); diff --git a/packages/react-server/lib/loader/module-alias.mjs b/packages/react-server/lib/loader/module-alias.mjs index 36bb33a7..08e3cc7d 100644 --- a/packages/react-server/lib/loader/module-alias.mjs +++ b/packages/react-server/lib/loader/module-alias.mjs @@ -26,7 +26,9 @@ export function moduleAliases(condition) { // noop } + let reactClient = react; if (condition === "react-server") { + reactClient = react; react = react.replace(/index\.js$/, "react.react-server.js"); reactJsxRuntime = reactJsxRuntime.replace( /jsx-runtime\.js$/, @@ -39,6 +41,7 @@ export function moduleAliases(condition) { reactDom = reactDom.replace(/index\.js$/, "react-dom.react-server.js"); } else { react = react.replace(/react\.react-server\.js$/, "index.js"); + reactClient = react; reactJsxRuntime = reactJsxRuntime.replace( /jsx-runtime\.react-server\.js$/, "jsx-runtime.js" @@ -76,6 +79,9 @@ export function moduleAliases(condition) { const unstorageDriversSessionStorage = normalizePath( __require.resolve("unstorage/drivers/session-storage") ); + const reactServerHighlightJs = normalizePath( + __require.resolve("highlight.js") + ); let vite; try { vite = normalizePath(__require.resolve("rolldown-vite")).replace( @@ -88,6 +94,7 @@ export function moduleAliases(condition) { const moduleAliases = { react, + "react/client": reactClient, "react/jsx-runtime": reactJsxRuntime, "react/jsx-dev-runtime": reactJsxDevRuntime, "react-dom": reactDom, @@ -102,6 +109,7 @@ export function moduleAliases(condition) { "unstorage/drivers/session-storage": unstorageDriversSessionStorage, vite, scheduler, + "react-server-highlight.js": reactServerHighlightJs, }; return moduleAliases; diff --git a/packages/react-server/lib/loader/node-loader.mjs b/packages/react-server/lib/loader/node-loader.mjs index 041bf8a7..316ce559 100644 --- a/packages/react-server/lib/loader/node-loader.mjs +++ b/packages/react-server/lib/loader/node-loader.mjs @@ -1,8 +1,31 @@ +import { existsSync } from "node:fs"; +import { fileURLToPath, pathToFileURL } from "node:url"; + import { moduleAliases } from "../loader/module-alias.mjs"; import { applyAlias } from "./utils.mjs"; const alias = moduleAliases(); export async function resolve(specifier, context, nextResolve) { - return await nextResolve(applyAlias(alias, specifier), context); + try { + return await nextResolve(applyAlias(alias, specifier), context); + } catch (e) { + if (e.code === "ERR_MODULE_NOT_FOUND" && !specifier.endsWith(".js")) { + const jsSpecifier = `${specifier}.js`; + + if (jsSpecifier.startsWith("file:")) { + const candidatePath = fileURLToPath(jsSpecifier); + if (existsSync(candidatePath)) { + return await nextResolve(pathToFileURL(candidatePath).href, context); + } + } else { + try { + return await nextResolve(jsSpecifier, context); + } catch { + throw e; + } + } + } + throw e; + } } diff --git a/packages/react-server/lib/loader/node-loader.react-server.mjs b/packages/react-server/lib/loader/node-loader.react-server.mjs index 6dee1ae4..ead3627b 100644 --- a/packages/react-server/lib/loader/node-loader.react-server.mjs +++ b/packages/react-server/lib/loader/node-loader.react-server.mjs @@ -6,16 +6,46 @@ import { applyAlias } from "./utils.mjs"; const alias = moduleAliases("react-server"); const reactUrl = pathToFileURL(alias.react); +const reactClientUrl = pathToFileURL(alias["react/client"]); export async function resolve(specifier, context, nextResolve) { - return await nextResolve(applyAlias(alias, specifier), { + const reactServerContext = { ...context, conditions: [...context.conditions, "react-server"], - }); + }; + try { + return await nextResolve(applyAlias(alias, specifier), { + ...reactServerContext, + }); + } catch (e) { + if (e.code === "ERR_MODULE_NOT_FOUND" && !specifier.endsWith(".js")) { + const jsSpecifier = `${specifier}.js`; + + if (jsSpecifier.startsWith("file:")) { + const candidatePath = fileURLToPath(jsSpecifier); + try { + await readFile(candidatePath); + return await nextResolve( + pathToFileURL(candidatePath).href, + reactServerContext + ); + } catch { + throw e; + } + } else { + try { + return await nextResolve(jsSpecifier, reactServerContext); + } catch { + throw e; + } + } + } + throw e; + } } export async function load(url, context, nextLoad) { - if (url === reactUrl.href) { + if (url === reactUrl.href || url === reactClientUrl.href) { const format = "commonjs"; const code = await readFile(fileURLToPath(reactUrl), "utf8"); const source = reactServerPatch(code); diff --git a/packages/react-server/lib/plugins/optimize-deps.mjs b/packages/react-server/lib/plugins/optimize-deps.mjs index 2a346eb8..6d5db037 100644 --- a/packages/react-server/lib/plugins/optimize-deps.mjs +++ b/packages/react-server/lib/plugins/optimize-deps.mjs @@ -6,6 +6,7 @@ import { bareImportRE, isModule, isRootModule, + nodeResolve, tryStat, } from "../utils/module.mjs"; @@ -33,7 +34,9 @@ export default function optimizeDeps() { tryStat(path)?.isFile() ) { if (!isModule(path)) { - return { externalize: specifier }; + return { + externalize: nodeResolve(specifier, importer), + }; } try { const content = await readFile(path, "utf-8"); @@ -51,7 +54,9 @@ export default function optimizeDeps() { } catch { // ignore } - return { externalize: specifier }; + return { + externalize: nodeResolve(specifier, importer), + }; } else if ( this.environment.name === "client" && !this.environment.depsOptimizer?.isOptimizedDepFile(specifier) && @@ -82,9 +87,15 @@ export default function optimizeDeps() { // ignore } } - return resolved || { externalize: specifier }; + return ( + resolved || { + externalize: nodeResolve(specifier, importer), + } + ); } catch { - return { externalize: specifier }; + return { + externalize: nodeResolve(specifier, importer), + }; } }, }; diff --git a/packages/react-server/lib/plugins/resolve-workspace.mjs b/packages/react-server/lib/plugins/resolve-workspace.mjs index 35c95ca3..37bbc4bb 100644 --- a/packages/react-server/lib/plugins/resolve-workspace.mjs +++ b/packages/react-server/lib/plugins/resolve-workspace.mjs @@ -1,11 +1,11 @@ import { realpathSync } from "node:fs"; -import { basename, join, relative } from "node:path"; -import { fileURLToPath } from "node:url"; +import { basename, join } from "node:path"; -import * as sys from "../sys.mjs"; -import { bareImportRE, findPackageRoot } from "../utils/module.mjs"; - -const cwd = sys.cwd(); +import { + bareImportRE, + findPackageRoot, + nodeResolve, +} from "../utils/module.mjs"; export default function resolveWorkspace() { return { @@ -14,13 +14,13 @@ export default function resolveWorkspace() { filter: { id: bareImportRE, }, - async handler(id, importer) { + async handler(specifier, importer) { if ( this.environment.mode === "build" || (this.environment.name === "client" && - bareImportRE.test(id) && - !id.startsWith("\0") && - !id.startsWith("virtual:")) + bareImportRE.test(specifier) && + !specifier.startsWith("\0") && + !specifier.startsWith("virtual:")) ) { try { const packageRoot = realpathSync(findPackageRoot(importer)); @@ -32,10 +32,7 @@ export default function resolveWorkspace() { parentPath = join(parentPath, ".."); } parentPath = join(parentPath, ".."); - return ( - (await this.resolve(id, parentPath)) || - fileURLToPath(relative(cwd, import.meta.resolve(id))) - ); + return nodeResolve(specifier, importer); } catch { return null; } diff --git a/packages/react-server/lib/utils/check.mjs b/packages/react-server/lib/utils/check.mjs index 662bb2d2..b1150541 100644 --- a/packages/react-server/lib/utils/check.mjs +++ b/packages/react-server/lib/utils/check.mjs @@ -1,4 +1,5 @@ import { createRequire } from "node:module"; +import { join } from "node:path"; import colors from "picocolors"; import semver from "semver"; @@ -54,13 +55,24 @@ export async function checkReactDependencies() { const pkgPath = __require.resolve(`${pkg}/package.json`, { paths: [process.cwd()], }); - const { - default: { version: userPkgVersion }, - } = await import(pkgPath, { with: { type: "json" } }); + const [ + { + default: { version: userPkgVersion }, + }, + userPkg, + ] = await Promise.all([ + import(pkgPath, { with: { type: "json" } }), + import(join(process.cwd(), "package.json"), { + with: { type: "json" }, + }), + ]); const systemPkgVersion = packageJson.dependencies?.[pkg] || packageJson.peerDependencies?.[pkg]; - if (userPkgVersion !== systemPkgVersion) { + if ( + userPkgVersion !== systemPkgVersion && + (userPkg.dependencies?.[pkg] || userPkg.devDependencies?.[pkg]) + ) { uninstall.push( ` ${colors.cyan(`${pkg}@${userPkgVersion}`)} ${colors.red(`expected: ${pkg}@${systemPkgVersion}`)} \n` ); diff --git a/packages/react-server/lib/utils/module.mjs b/packages/react-server/lib/utils/module.mjs index 3be54054..89dbeb63 100644 --- a/packages/react-server/lib/utils/module.mjs +++ b/packages/react-server/lib/utils/module.mjs @@ -2,6 +2,8 @@ import { readdirSync, readFileSync, statSync } from "node:fs"; import { dirname, join, relative } from "node:path"; import { fileURLToPath } from "node:url"; +import { ResolverFactory } from "oxc-resolver"; + import * as sys from "../sys.mjs"; const cwd = sys.cwd(); @@ -176,3 +178,50 @@ export function hasServerAction(filePath) { } return false; } + +function getExportSubpath(pkg, id) { + if (!pkg?.name) return null; + if (id === pkg.name) return "."; + + let idx = id.indexOf(pkg.name); + if (idx === -1) return null; + + idx += pkg.name.length + 1; + return "./" + id.slice(idx); +} + +export function isSubpathExported(pkg, id) { + if (pkg?.name === id || pkg?.exports?.[id]) return true; + if (!pkg?.exports) return false; + + const rel = getExportSubpath(pkg, id); + if (!rel) return false; + + for (const key of Object.keys(pkg.exports)) { + if (key === rel) return true; + if (key.includes("*")) { + const prefix = key.split("*")[0]; + if (rel.startsWith(prefix)) return true; + } + } + return false; +} + +const resolve = new ResolverFactory({ + conditionNames: ["module", "import", "require", "node", "default"], +}); +export function nodeResolve(specifier, importer) { + try { + if (bareImportRE.test(specifier)) { + return ( + resolve.sync( + /\.(?:m?[jt]sx?)|json$/.test(importer) ? dirname(importer) : importer, + specifier + ).path || specifier + ); + } + return specifier; + } catch { + return specifier; + } +} diff --git a/packages/react-server/package.json b/packages/react-server/package.json index ed6f6e11..a9ec8704 100644 --- a/packages/react-server/package.json +++ b/packages/react-server/package.json @@ -139,6 +139,7 @@ "module-alias": "^2.2.3", "open": "^9.1.0", "oxc-parser": "^0.61.2", + "oxc-resolver": "^11.9.0", "parse5": "^7.1.2", "picocolors": "^1.0.1", "pino": "^8.14.1", diff --git a/packages/react-server/server/GlobalError.jsx b/packages/react-server/server/GlobalError.jsx index 51b66898..ccd4caa0 100644 --- a/packages/react-server/server/GlobalError.jsx +++ b/packages/react-server/server/GlobalError.jsx @@ -1,8 +1,8 @@ import { createRequire } from "node:module"; import { useRender, useUrl } from "@lazarv/react-server"; -import hljs from "highlight.js"; -import "highlight.js/styles/github-dark.min.css"; +import hljs from "react-server-highlight.js"; +import "react-server-highlight.js/styles/github-dark.min.css"; import { style, remoteStyle } from "./error-styles.mjs"; import { prepareError } from "../lib/handlers/error.mjs"; @@ -78,6 +78,7 @@ export default async function GlobalError({ error }) { ${error.code.trim()}`, __html: hljs.highlight(error.code, { language: "javascript" }) .value, }} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a752140d..d613fb27 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -590,6 +590,15 @@ importers: specifier: ^1.2.0 version: 1.2.0 + examples/react-syntax-highlighter: + dependencies: + '@lazarv/react-server': + specifier: workspace:^ + version: link:../../packages/react-server + react-syntax-highlighter: + specifier: ^15.6.6 + version: 15.6.6(react@19.0.0-rc-a7d1240c-20240731) + examples/remote: dependencies: '@lazarv/react-server': @@ -836,6 +845,9 @@ importers: oxc-parser: specifier: ^0.61.2 version: 0.61.2 + oxc-resolver: + specifier: ^11.9.0 + version: 11.9.0 parse5: specifier: ^7.1.2 version: 7.1.2 @@ -2015,6 +2027,9 @@ packages: '@emnapi/core@1.4.5': resolution: {integrity: sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==} + '@emnapi/core@1.5.0': + resolution: {integrity: sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg==} + '@emnapi/runtime@1.3.1': resolution: {integrity: sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==} @@ -2024,6 +2039,9 @@ packages: '@emnapi/runtime@1.4.5': resolution: {integrity: sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==} + '@emnapi/runtime@1.5.0': + resolution: {integrity: sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==} + '@emnapi/wasi-threads@1.0.1': resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} @@ -2033,6 +2051,9 @@ packages: '@emnapi/wasi-threads@1.0.4': resolution: {integrity: sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==} + '@emnapi/wasi-threads@1.1.0': + resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} + '@emotion/babel-plugin@11.12.0': resolution: {integrity: sha512-y2WQb+oP8Jqvvclh8Q55gLUyb7UFvgv7eJfsj7td5TToBrIUtPay2kMrZi4xjq9qw2vD0ZR5fSho0yqoFgX7Rw==} @@ -2617,6 +2638,9 @@ packages: '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} @@ -2876,6 +2900,9 @@ packages: '@napi-rs/wasm-runtime@1.0.1': resolution: {integrity: sha512-KVlQ/jgywZpixGCKMNwxStmmbYEMyokZpCf2YuIChhfJA2uqfAKNEM8INz7zzTo55iEXfBhIIs3VqYyqzDLj8g==} + '@napi-rs/wasm-runtime@1.0.6': + resolution: {integrity: sha512-DXj75ewm11LIWUk198QSKUTxjyRjsBwk09MuMk5DGK+GDUtyPhhEHOGP/Xwwj3DjQXXkivoBirmOnKrLfc0+9g==} + '@nestjs/cli@10.4.9': resolution: {integrity: sha512-s8qYd97bggqeK7Op3iD49X2MpFtW4LVNLAwXFkfbRxKME6IYT7X0muNTJ2+QfI8hpbNx9isWkrLWIp+g5FOhiA==} engines: {node: '>= 16.14'} @@ -3160,6 +3187,101 @@ packages: '@oxc-project/types@0.78.0': resolution: {integrity: sha512-8FvExh0WRWN1FoSTjah1xa9RlavZcJQ8/yxRbZ7ElmSa2Ij5f5Em7MvRbSthE6FbwC6Wh8iAw0Gpna7QdoqLGg==} + '@oxc-resolver/binding-android-arm-eabi@11.9.0': + resolution: {integrity: sha512-4AxaG6TkSBQ2FiC5oGZEJQ35DjsSfAbW6/AJauebq4EzIPVOIgDJCF4de+PvX/Xi9BkNw6VtJuMXJdWW97iEAA==} + cpu: [arm] + os: [android] + + '@oxc-resolver/binding-android-arm64@11.9.0': + resolution: {integrity: sha512-oOEg7rUd2M6YlmRkvPcszJ6KO6TaLGN21oDdcs27gbTVYbQQtCWYbZz5jRW5zEBJu6dopoWVx+shJNGtG1qDFw==} + cpu: [arm64] + os: [android] + + '@oxc-resolver/binding-darwin-arm64@11.9.0': + resolution: {integrity: sha512-fM6zE/j6o3C1UIkcZPV7C1f186R7w97guY2N4lyNLlhlgwwhd46acnOezLARvRNU5oyKNev4PvOJhGCCDnFMGg==} + cpu: [arm64] + os: [darwin] + + '@oxc-resolver/binding-darwin-x64@11.9.0': + resolution: {integrity: sha512-Bg3Orw7gAxbUqQlt64YPWvHDVo3bo2JfI26Qmzv6nKo7mIMTDhQKl7YmywtLNMYbX0IgUM4qu1V90euu+WCDOw==} + cpu: [x64] + os: [darwin] + + '@oxc-resolver/binding-freebsd-x64@11.9.0': + resolution: {integrity: sha512-eBqVZqTETH6miBfIZXvpzUe98WATz2+Sh+LEFwuRpGsTsKkIpTyb4p1kwylCLkxrd3Yx7wkxQku+L0AMEGBiAA==} + cpu: [x64] + os: [freebsd] + + '@oxc-resolver/binding-linux-arm-gnueabihf@11.9.0': + resolution: {integrity: sha512-QgCk/IJnGBvpbc8rYTVgO+A3m3edJjH1zfv8Nvx7fmsxpbXwWH2l4b4tY3/SLMzasxsp7x7k87+HWt095bI5Lg==} + cpu: [arm] + os: [linux] + + '@oxc-resolver/binding-linux-arm-musleabihf@11.9.0': + resolution: {integrity: sha512-xkJH0jldIXD2GwoHpCDEF0ucJ7fvRETCL+iFLctM679o7qeDXvtzsO/E401EgFFXcWBJNKXWvH+ZfdYMKyowfA==} + cpu: [arm] + os: [linux] + + '@oxc-resolver/binding-linux-arm64-gnu@11.9.0': + resolution: {integrity: sha512-TWq+y2psMzbMtZB9USAq2bSA7NV1TMmh9lhAFbMGQ8Yp2YV4BRC/HilD6qF++efQl6shueGBFOv0LVe9BUXaIA==} + cpu: [arm64] + os: [linux] + + '@oxc-resolver/binding-linux-arm64-musl@11.9.0': + resolution: {integrity: sha512-8WwGLfXk7yttc6rD6g53+RnYfX5B8xOot1ffthLn8oCXzVRO4cdChlmeHStxwLD/MWx8z8BGeyfyINNrsh9N2w==} + cpu: [arm64] + os: [linux] + + '@oxc-resolver/binding-linux-ppc64-gnu@11.9.0': + resolution: {integrity: sha512-ZWiAXfan6actlSzayaFS/kYO2zD6k1k0fmLb1opbujXYMKepEnjjVOvKdzCIYR/zKzudqI39dGc+ywqVdsPIpQ==} + cpu: [ppc64] + os: [linux] + + '@oxc-resolver/binding-linux-riscv64-gnu@11.9.0': + resolution: {integrity: sha512-p9mCSb+Bym+eycNo9k+81wQ5SAE31E+/rtfbDmF4/7krPotkEjPsEBSc3rqunRwO+FtsUn7H68JLY7hlai49eQ==} + cpu: [riscv64] + os: [linux] + + '@oxc-resolver/binding-linux-riscv64-musl@11.9.0': + resolution: {integrity: sha512-/SePuVxgFhLPciRwsJ8kLVltr+rxh0b6riGFuoPnFXBbHFclKnjNIt3TfqzUj0/vOnslXw3cVGPpmtkm2TgCgg==} + cpu: [riscv64] + os: [linux] + + '@oxc-resolver/binding-linux-s390x-gnu@11.9.0': + resolution: {integrity: sha512-zLuEjlYIzfnr1Ei2UZYQBbCTa/9deh+BEjO9rh1ai8BfEq4uj6RupTtNpgHfgAsEYdqOBVExw9EU1S6SW3RCAw==} + cpu: [s390x] + os: [linux] + + '@oxc-resolver/binding-linux-x64-gnu@11.9.0': + resolution: {integrity: sha512-cxdg73WG+aVlPu/k4lEQPRVOhWunYOUglW6OSzclZLJJAXZU0tSZ5ymKaqPRkfTsyNSAafj1cA1XYd+P9UxBgw==} + cpu: [x64] + os: [linux] + + '@oxc-resolver/binding-linux-x64-musl@11.9.0': + resolution: {integrity: sha512-sy5nkVdMvNgqcx9sIY7G6U9TYZUZC4cmMGw/wKhJNuuD2/HFGtbje62ttXSwBAbVbmJ2GgZ4ZUo/S1OMyU+/OA==} + cpu: [x64] + os: [linux] + + '@oxc-resolver/binding-wasm32-wasi@11.9.0': + resolution: {integrity: sha512-dfi/a0Xh6o6nOLbJdaYuy7txncEcwkRHp9DGGZaAP7zxDiepkBZ6ewSJODQrWwhjVmMteXo+XFzEOMjsC7WUtQ==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@oxc-resolver/binding-win32-arm64-msvc@11.9.0': + resolution: {integrity: sha512-b1yKr+eFwyi8pZMjAQwW352rXpaHAmz7FLK03vFIxdyWzWiiL6S3UrfMu+nKQud38963zu4wNNLm7rdXQazgRA==} + cpu: [arm64] + os: [win32] + + '@oxc-resolver/binding-win32-ia32-msvc@11.9.0': + resolution: {integrity: sha512-DxRT+1HjCpRH8qYCmGHzgsRCYiK+X14PUM9Fb+aD4TljplA7MdDQXqMISTb4zBZ70AuclvlXKTbW+K1GZop3xA==} + cpu: [ia32] + os: [win32] + + '@oxc-resolver/binding-win32-x64-msvc@11.9.0': + resolution: {integrity: sha512-gE3QJvhh0Yj9cSAkkHjRLKPmC7BTJeiaB5YyhVKVUwbnWQgTszV92lZ9pvZtNPEghP7jPbhEs4c6983A0ojQwA==} + cpu: [x64] + os: [win32] + '@parcel/watcher-android-arm64@2.5.1': resolution: {integrity: sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==} engines: {node: '>= 10.0.0'} @@ -4002,6 +4124,9 @@ packages: '@tybys/wasm-util@0.10.0': resolution: {integrity: sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==} + '@tybys/wasm-util@0.10.1': + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@tybys/wasm-util@0.9.0': resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} @@ -4104,6 +4229,9 @@ packages: '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + '@types/hast@2.3.10': + resolution: {integrity: sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==} + '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} @@ -4924,9 +5052,9 @@ packages: ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} - chai@5.2.0: - resolution: {integrity: sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==} - engines: {node: '>=12'} + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} @@ -4947,12 +5075,21 @@ packages: character-entities-html4@2.1.0: resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + character-entities-legacy@1.1.4: + resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} + character-entities-legacy@3.0.0: resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + character-entities@1.2.4: + resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} + character-entities@2.0.2: resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + character-reference-invalid@1.1.4: + resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} + character-reference-invalid@2.0.1: resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} @@ -5080,6 +5217,9 @@ packages: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + comma-separated-tokens@1.0.8: + resolution: {integrity: sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==} + comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} @@ -5379,6 +5519,15 @@ packages: supports-color: optional: true + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decimal.js-light@2.5.1: resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==} @@ -5658,9 +5807,6 @@ packages: resolution: {integrity: sha512-/SurEfycdyssORP/E+bj4sEu1CWw4EmLDsHynHwSXQ7utgbrMRWW195pTrCjFgFCddf/UkYm3oqKPRq5i8bJbw==} engines: {node: '>= 0.4'} - es-module-lexer@1.6.0: - resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} - es-module-lexer@1.7.0: resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} @@ -5903,8 +6049,8 @@ packages: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} - expect-type@1.2.1: - resolution: {integrity: sha512-/kP8CAwxzLVEeFrMm4kMmy4CCDlpipyA7MYLVrdJIkV0fYF0UaigQHRsxHiuY/GEea+bh4KSv3TIlgr+2UL6bw==} + expect-type@1.2.2: + resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==} engines: {node: '>=12.0.0'} expect@29.7.0: @@ -5965,6 +6111,9 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + fault@1.0.4: + resolution: {integrity: sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==} + fault@2.0.1: resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} @@ -5987,6 +6136,15 @@ packages: picomatch: optional: true + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + fflate@0.8.2: resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==} @@ -6327,6 +6485,9 @@ packages: hast-util-is-element@3.0.0: resolution: {integrity: sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==} + hast-util-parse-selector@2.2.5: + resolution: {integrity: sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==} + hast-util-properties-to-mdx-jsx-attributes@1.0.0: resolution: {integrity: sha512-MZEdAYiXC8wDBfntAc7syyWHbcg/X1h03DQ7IQ6MKagMttpYhnKqOZR/nia0657Dt2v2vuXB8YuKNExw0Fljew==} @@ -6342,10 +6503,16 @@ packages: hast-util-whitespace@3.0.0: resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + hastscript@6.0.0: + resolution: {integrity: sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==} + hexoid@2.0.0: resolution: {integrity: sha512-qlspKUK7IlSQv2o+5I7yhUd7TxlOG2Vr5LTa3ve2XSNVKAL/n/u/7KLvKmFNimomDIKvZFXWHv0T12mv7rT8Aw==} engines: {node: '>=8'} + highlight.js@10.7.3: + resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==} + highlight.js@11.11.1: resolution: {integrity: sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==} engines: {node: '>=12.0.0'} @@ -6354,6 +6521,9 @@ packages: resolution: {integrity: sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==} engines: {node: '>=12.0.0'} + highlightjs-vue@1.0.0: + resolution: {integrity: sha512-PDEfEF102G23vHmPhLyPboFCD+BkMGu+GuJe2d9/eH4FsCwvgBpnc9n0pGE+ffKdph38s6foEZiEjdgHdzp+IA==} + hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} @@ -6497,9 +6667,15 @@ packages: iron-webcrypto@1.2.1: resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==} + is-alphabetical@1.0.4: + resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} + is-alphabetical@2.0.1: resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} + is-alphanumerical@1.0.4: + resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} + is-alphanumerical@2.0.1: resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} @@ -6541,6 +6717,9 @@ packages: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} + is-decimal@1.0.4: + resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} + is-decimal@2.0.1: resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} @@ -6585,6 +6764,9 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-hexadecimal@1.0.4: + resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} + is-hexadecimal@2.0.1: resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} @@ -7243,15 +7425,15 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true - loupe@3.1.3: - resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} - loupe@3.1.4: resolution: {integrity: sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==} lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} + lowlight@1.20.0: + resolution: {integrity: sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==} + lowlight@3.1.0: resolution: {integrity: sha512-CEbNVoSikAxwDMDPjXlqlFYiZLkDJHwyGu/MfOsJnF3d7f3tds5J3z8s/l9TMXhzfsJCCJEAsD78842mwmg0PQ==} @@ -7269,8 +7451,8 @@ packages: magic-string@0.30.10: resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} - magic-string@0.30.17: - resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + magic-string@0.30.19: + resolution: {integrity: sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==} magic-string@0.30.8: resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==} @@ -7845,6 +8027,9 @@ packages: resolution: {integrity: sha512-ZJnAP7VLQhqqnfku7+gssTwmbQyfbZ552Vly4O2BMHkvDwfwLlPtAIYjMq57Lcj5HLmopI0oZlk7xTSML/YsZA==} engines: {node: '>=14.0.0'} + oxc-resolver@11.9.0: + resolution: {integrity: sha512-u714L0DBBXpD0ERErCQlun2XwinuBfIGo2T8bA7xE8WLQ4uaJudO/VOEQCWslOmcDY2nEkS+UVir5PpyvSG23w==} + p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} @@ -7883,6 +8068,9 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} + parse-entities@2.0.0: + resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} + parse-entities@4.0.1: resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} @@ -7963,8 +8151,8 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pathval@2.0.0: - resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} engines: {node: '>= 14.16'} periscopic@3.1.0: @@ -8188,6 +8376,14 @@ packages: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + prismjs@1.27.0: + resolution: {integrity: sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==} + engines: {node: '>=6'} + + prismjs@1.30.0: + resolution: {integrity: sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==} + engines: {node: '>=6'} + process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -8205,6 +8401,9 @@ packages: prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + property-information@5.6.0: + resolution: {integrity: sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==} + property-information@6.5.0: resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} @@ -8471,6 +8670,11 @@ packages: '@types/react': optional: true + react-syntax-highlighter@15.6.6: + resolution: {integrity: sha512-DgXrc+AZF47+HvAPEmn7Ua/1p10jNoVZVI/LoPiYdtY+OM+/nG5yefLHKJwdKqY1adMuHFbeyBaG9j64ML7vTw==} + peerDependencies: + react: '>= 0.14.0' + react-textarea-autosize@8.5.3: resolution: {integrity: sha512-XT1024o2pqCuZSuBt9FwHlaDeNtVrtCXu0Rnz88t1jUGheCLa3PhjE1GH8Ctm2axEtvdCl5SUHYschyQ0L5QHQ==} engines: {node: '>=10'} @@ -8542,6 +8746,9 @@ packages: resolution: {integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==} engines: {node: '>= 0.4'} + refractor@3.6.0: + resolution: {integrity: sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA==} + regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} @@ -8988,6 +9195,9 @@ packages: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} engines: {node: '>= 8'} + space-separated-tokens@1.1.5: + resolution: {integrity: sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==} + space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} @@ -9122,8 +9332,8 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - strip-literal@3.0.0: - resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==} + strip-literal@3.1.0: + resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} style-to-js@1.1.12: resolution: {integrity: sha512-tv+/FkgNYHI2fvCoBMsqPHh5xovwiw+C3X0Gfnss/Syau0Nr3IqGOJ9XiOYXoPnToHVbllKFf5qCNFJGwFg5mg==} @@ -9291,6 +9501,10 @@ packages: 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'} + tinypool@1.1.1: resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} engines: {node: ^18.0.0 || >=20.0.0} @@ -9299,8 +9513,8 @@ packages: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} - tinyspy@4.0.3: - resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + tinyspy@4.0.4: + resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} tippy.js@6.3.7: @@ -10496,7 +10710,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.24.7 '@babel/parser': 7.27.0 '@babel/types': 7.27.0 - debug: 4.4.0 + debug: 4.4.1 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -10508,7 +10722,7 @@ snapshots: '@babel/parser': 7.27.0 '@babel/template': 7.27.0 '@babel/types': 7.27.0 - debug: 4.4.0 + debug: 4.4.3 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -11387,6 +11601,12 @@ snapshots: tslib: 2.8.1 optional: true + '@emnapi/core@1.5.0': + dependencies: + '@emnapi/wasi-threads': 1.1.0 + tslib: 2.8.1 + optional: true + '@emnapi/runtime@1.3.1': dependencies: tslib: 2.8.1 @@ -11402,6 +11622,11 @@ snapshots: tslib: 2.8.1 optional: true + '@emnapi/runtime@1.5.0': + dependencies: + tslib: 2.8.1 + optional: true + '@emnapi/wasi-threads@1.0.1': dependencies: tslib: 2.8.1 @@ -11417,6 +11642,11 @@ snapshots: tslib: 2.8.1 optional: true + '@emnapi/wasi-threads@1.1.0': + dependencies: + tslib: 2.8.1 + optional: true + '@emotion/babel-plugin@11.12.0': dependencies: '@babel/helper-module-imports': 7.24.7 @@ -11590,7 +11820,7 @@ snapshots: '@eslint/config-array@0.18.0': dependencies: '@eslint/object-schema': 2.1.4 - debug: 4.4.0 + debug: 4.4.3 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -11600,7 +11830,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.4.0 + debug: 4.4.1 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -11676,7 +11906,7 @@ snapshots: '@humanwhocodes/config-array@0.13.0': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.4.0 + debug: 4.4.1 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -11814,7 +12044,7 @@ snapshots: '@lix-js/client': 2.2.1 '@lix-js/fs': 2.2.0 '@sinclair/typebox': 0.31.28 - debug: 4.4.0 + debug: 4.4.3 dedent: 1.5.1(babel-plugin-macros@3.1.0) deepmerge-ts: 5.1.0 murmurhash3js: 3.0.1 @@ -11838,7 +12068,7 @@ snapshots: '@lix-js/client': 2.2.1 '@lix-js/fs': 2.2.0 '@sinclair/typebox': 0.31.28 - debug: 4.4.0 + debug: 4.4.3 dedent: 1.5.1(babel-plugin-macros@3.1.0) deepmerge-ts: 5.1.0 murmurhash3js: 3.0.1 @@ -11862,7 +12092,7 @@ snapshots: '@lix-js/client': 2.2.1 '@lix-js/fs': 2.2.0 '@sinclair/typebox': 0.31.28 - debug: 4.4.0 + debug: 4.4.1 dedent: 1.5.1(babel-plugin-macros@3.1.0) deepmerge-ts: 5.1.0 murmurhash3js: 3.0.1 @@ -12310,7 +12540,7 @@ snapshots: '@jridgewell/gen-mapping@0.3.8': dependencies: '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.29 '@jridgewell/resolve-uri@3.1.2': {} @@ -12324,10 +12554,12 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.0': {} + '@jridgewell/sourcemap-codec@1.5.5': {} + '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping@0.3.29': dependencies: @@ -12337,7 +12569,7 @@ snapshots: '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@jsdevtools/ez-spawn@3.0.4': dependencies: @@ -12640,6 +12872,13 @@ snapshots: '@tybys/wasm-util': 0.10.0 optional: true + '@napi-rs/wasm-runtime@1.0.6': + dependencies: + '@emnapi/core': 1.5.0 + '@emnapi/runtime': 1.5.0 + '@tybys/wasm-util': 0.10.1 + optional: true + '@nestjs/cli@10.4.9(@swc/core@1.11.21)': dependencies: '@angular-devkit/core': 17.3.11(chokidar@3.6.0) @@ -12963,6 +13202,65 @@ snapshots: '@oxc-project/types@0.78.0': {} + '@oxc-resolver/binding-android-arm-eabi@11.9.0': + optional: true + + '@oxc-resolver/binding-android-arm64@11.9.0': + optional: true + + '@oxc-resolver/binding-darwin-arm64@11.9.0': + optional: true + + '@oxc-resolver/binding-darwin-x64@11.9.0': + optional: true + + '@oxc-resolver/binding-freebsd-x64@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-arm-gnueabihf@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-arm-musleabihf@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-arm64-gnu@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-arm64-musl@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-ppc64-gnu@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-riscv64-gnu@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-riscv64-musl@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-s390x-gnu@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-x64-gnu@11.9.0': + optional: true + + '@oxc-resolver/binding-linux-x64-musl@11.9.0': + optional: true + + '@oxc-resolver/binding-wasm32-wasi@11.9.0': + dependencies: + '@napi-rs/wasm-runtime': 1.0.6 + optional: true + + '@oxc-resolver/binding-win32-arm64-msvc@11.9.0': + optional: true + + '@oxc-resolver/binding-win32-ia32-msvc@11.9.0': + optional: true + + '@oxc-resolver/binding-win32-x64-msvc@11.9.0': + optional: true + '@parcel/watcher-android-arm64@2.5.1': optional: true @@ -13146,7 +13444,7 @@ snapshots: dependencies: '@types/estree': 1.0.7 estree-walker: 2.0.2 - picomatch: 4.0.2 + picomatch: 4.0.3 optionalDependencies: rollup: 4.40.1 @@ -13672,6 +13970,11 @@ snapshots: tslib: 2.8.1 optional: true + '@tybys/wasm-util@0.10.1': + dependencies: + tslib: 2.8.1 + optional: true + '@tybys/wasm-util@0.9.0': dependencies: tslib: 2.8.1 @@ -13799,6 +14102,10 @@ snapshots: dependencies: '@types/node': 20.17.11 + '@types/hast@2.3.10': + dependencies: + '@types/unist': 2.0.10 + '@types/hast@3.0.4': dependencies: '@types/unist': 3.0.2 @@ -13999,7 +14306,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.7.2) '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.7.2) - debug: 4.4.0 + debug: 4.4.1 eslint: 8.57.1 ts-api-utils: 1.3.0(typescript@5.7.2) optionalDependencies: @@ -14011,7 +14318,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.11.0(typescript@5.7.2) '@typescript-eslint/utils': 8.11.0(eslint@9.13.0(jiti@2.4.2))(typescript@5.7.2) - debug: 4.4.0 + debug: 4.4.3 ts-api-utils: 1.3.0(typescript@5.7.2) optionalDependencies: typescript: 5.7.2 @@ -14027,7 +14334,7 @@ snapshots: dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.4.0 + debug: 4.4.1 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -14042,7 +14349,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.11.0 '@typescript-eslint/visitor-keys': 8.11.0 - debug: 4.4.0 + debug: 4.4.3 fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 @@ -14122,14 +14429,14 @@ snapshots: '@types/chai': 5.2.2 '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 - chai: 5.2.0 + chai: 5.3.3 tinyrainbow: 2.0.0 '@vitest/mocker@3.2.4(rolldown-vite@7.0.3(@types/node@20.17.11)(esbuild@0.25.1)(jiti@2.4.2)(less@4.2.0)(sass@1.86.0)(stylus@0.62.0)(terser@5.37.0)(yaml@2.5.0))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 - magic-string: 0.30.17 + magic-string: 0.30.19 optionalDependencies: vite: rolldown-vite@7.0.3(@types/node@20.17.11)(esbuild@0.25.1)(jiti@2.4.2)(less@4.2.0)(sass@1.86.0)(stylus@0.62.0)(terser@5.37.0)(yaml@2.5.0) @@ -14141,17 +14448,17 @@ snapshots: dependencies: '@vitest/utils': 3.2.4 pathe: 2.0.3 - strip-literal: 3.0.0 + strip-literal: 3.1.0 '@vitest/snapshot@3.2.4': dependencies: '@vitest/pretty-format': 3.2.4 - magic-string: 0.30.17 + magic-string: 0.30.19 pathe: 2.0.3 '@vitest/spy@3.2.4': dependencies: - tinyspy: 4.0.3 + tinyspy: 4.0.4 '@vitest/ui@3.2.4(vitest@3.2.4)': dependencies: @@ -14665,7 +14972,7 @@ snapshots: dependencies: bytes: 3.1.2 content-type: 1.0.5 - debug: 4.4.0 + debug: 4.4.3 http-errors: 2.0.0 iconv-lite: 0.6.3 on-finished: 2.4.1 @@ -14771,13 +15078,13 @@ snapshots: ccount@2.0.1: {} - chai@5.2.0: + chai@5.3.3: dependencies: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.3 - pathval: 2.0.0 + loupe: 3.1.4 + pathval: 2.0.1 chalk@2.4.2: dependencies: @@ -14796,10 +15103,16 @@ snapshots: character-entities-html4@2.1.0: {} + character-entities-legacy@1.1.4: {} + character-entities-legacy@3.0.0: {} + character-entities@1.2.4: {} + character-entities@2.0.2: {} + character-reference-invalid@1.1.4: {} + character-reference-invalid@2.0.1: {} chardet@0.7.0: {} @@ -14905,6 +15218,8 @@ snapshots: dependencies: delayed-stream: 1.0.0 + comma-separated-tokens@1.0.8: {} + comma-separated-tokens@2.0.3: {} commander@11.1.0: {} @@ -15185,6 +15500,10 @@ snapshots: dependencies: ms: 2.1.3 + debug@4.4.3: + dependencies: + ms: 2.1.3 + decimal.js-light@2.5.1: {} decode-named-character-reference@1.0.2: @@ -15492,8 +15811,6 @@ snapshots: iterator.prototype: 1.1.3 safe-array-concat: 1.1.2 - es-module-lexer@1.6.0: {} - es-module-lexer@1.7.0: {} es-object-atoms@1.0.0: @@ -15871,7 +16188,7 @@ snapshots: expand-template@2.0.3: {} - expect-type@1.2.1: {} + expect-type@1.2.2: {} expect@29.7.0: dependencies: @@ -15929,7 +16246,7 @@ snapshots: content-type: 1.0.5 cookie: 0.7.2 cookie-signature: 1.2.2 - debug: 4.4.0 + debug: 4.4.3 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 @@ -15989,6 +16306,10 @@ snapshots: dependencies: reusify: 1.0.4 + fault@1.0.4: + dependencies: + format: 0.2.2 + fault@2.0.1: dependencies: format: 0.2.2 @@ -16009,6 +16330,10 @@ snapshots: optionalDependencies: picomatch: 4.0.3 + fdir@6.5.0(picomatch@4.0.3): + optionalDependencies: + picomatch: 4.0.3 + fflate@0.8.2: {} figures@3.2.0: @@ -16051,7 +16376,7 @@ snapshots: finalhandler@2.1.0: dependencies: - debug: 4.4.0 + debug: 4.4.3 encodeurl: 2.0.0 escape-html: 1.0.3 on-finished: 2.4.1 @@ -16363,6 +16688,8 @@ snapshots: dependencies: '@types/hast': 3.0.4 + hast-util-parse-selector@2.2.5: {} + hast-util-properties-to-mdx-jsx-attributes@1.0.0: dependencies: '@types/estree': 1.0.6 @@ -16428,12 +16755,24 @@ snapshots: dependencies: '@types/hast': 3.0.4 + hastscript@6.0.0: + dependencies: + '@types/hast': 2.3.10 + comma-separated-tokens: 1.0.8 + hast-util-parse-selector: 2.2.5 + property-information: 5.6.0 + space-separated-tokens: 1.1.5 + hexoid@2.0.0: {} + highlight.js@10.7.3: {} + highlight.js@11.11.1: {} highlight.js@11.9.0: {} + highlightjs-vue@1.0.0: {} + hoist-non-react-statics@3.3.2: dependencies: react-is: 16.13.1 @@ -16457,7 +16796,7 @@ snapshots: https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.3 - debug: 4.4.1 + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -16583,8 +16922,15 @@ snapshots: iron-webcrypto@1.2.1: {} + is-alphabetical@1.0.4: {} + is-alphabetical@2.0.1: {} + is-alphanumerical@1.0.4: + dependencies: + is-alphabetical: 1.0.4 + is-decimal: 1.0.4 + is-alphanumerical@2.0.1: dependencies: is-alphabetical: 2.0.1 @@ -16628,6 +16974,8 @@ snapshots: dependencies: has-tostringtag: 1.0.2 + is-decimal@1.0.4: {} + is-decimal@2.0.1: {} is-docker@2.2.1: {} @@ -16658,6 +17006,8 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-hexadecimal@1.0.4: {} + is-hexadecimal@2.0.1: {} is-inside-container@1.0.0: @@ -16778,7 +17128,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.4.0 + debug: 4.4.3 istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -17450,14 +17800,17 @@ snapshots: dependencies: js-tokens: 4.0.0 - loupe@3.1.3: {} - loupe@3.1.4: {} lower-case@2.0.2: dependencies: tslib: 2.8.1 + lowlight@1.20.0: + dependencies: + fault: 1.0.4 + highlight.js: 10.7.3 + lowlight@3.1.0: dependencies: '@types/hast': 3.0.4 @@ -17476,13 +17829,13 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 - magic-string@0.30.17: + magic-string@0.30.19: dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 magic-string@0.30.8: dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 make-dir@2.1.0: dependencies: @@ -17970,7 +18323,7 @@ snapshots: micromark@4.0.0: dependencies: '@types/debug': 4.1.12 - debug: 4.4.0 + debug: 4.4.3 decode-named-character-reference: 1.0.2 devlop: 1.1.0 micromark-core-commonmark: 2.0.1 @@ -18321,6 +18674,28 @@ snapshots: '@oxc-parser/binding-win32-arm64-msvc': 0.61.2 '@oxc-parser/binding-win32-x64-msvc': 0.61.2 + oxc-resolver@11.9.0: + optionalDependencies: + '@oxc-resolver/binding-android-arm-eabi': 11.9.0 + '@oxc-resolver/binding-android-arm64': 11.9.0 + '@oxc-resolver/binding-darwin-arm64': 11.9.0 + '@oxc-resolver/binding-darwin-x64': 11.9.0 + '@oxc-resolver/binding-freebsd-x64': 11.9.0 + '@oxc-resolver/binding-linux-arm-gnueabihf': 11.9.0 + '@oxc-resolver/binding-linux-arm-musleabihf': 11.9.0 + '@oxc-resolver/binding-linux-arm64-gnu': 11.9.0 + '@oxc-resolver/binding-linux-arm64-musl': 11.9.0 + '@oxc-resolver/binding-linux-ppc64-gnu': 11.9.0 + '@oxc-resolver/binding-linux-riscv64-gnu': 11.9.0 + '@oxc-resolver/binding-linux-riscv64-musl': 11.9.0 + '@oxc-resolver/binding-linux-s390x-gnu': 11.9.0 + '@oxc-resolver/binding-linux-x64-gnu': 11.9.0 + '@oxc-resolver/binding-linux-x64-musl': 11.9.0 + '@oxc-resolver/binding-wasm32-wasi': 11.9.0 + '@oxc-resolver/binding-win32-arm64-msvc': 11.9.0 + '@oxc-resolver/binding-win32-ia32-msvc': 11.9.0 + '@oxc-resolver/binding-win32-x64-msvc': 11.9.0 + p-limit@2.3.0: dependencies: p-try: 2.2.0 @@ -18355,6 +18730,15 @@ snapshots: dependencies: callsites: 3.1.0 + parse-entities@2.0.0: + dependencies: + character-entities: 1.2.4 + character-entities-legacy: 1.1.4 + character-reference-invalid: 1.1.4 + is-alphanumerical: 1.0.4 + is-decimal: 1.0.4 + is-hexadecimal: 1.0.4 + parse-entities@4.0.1: dependencies: '@types/unist': 2.0.10 @@ -18423,7 +18807,7 @@ snapshots: pathe@2.0.3: {} - pathval@2.0.0: {} + pathval@2.0.1: {} periscopic@3.1.0: dependencies: @@ -18639,6 +19023,10 @@ snapshots: ansi-styles: 5.2.0 react-is: 18.3.1 + prismjs@1.27.0: {} + + prismjs@1.30.0: {} + process-nextick-args@2.0.1: {} process-warning@3.0.0: {} @@ -18656,6 +19044,10 @@ snapshots: object-assign: 4.1.1 react-is: 16.13.1 + property-information@5.6.0: + dependencies: + xtend: 4.0.2 + property-information@6.5.0: {} prosemirror-changeset@2.2.1: @@ -18976,6 +19368,16 @@ snapshots: optionalDependencies: '@types/react': 18.3.5 + react-syntax-highlighter@15.6.6(react@19.0.0-rc-a7d1240c-20240731): + dependencies: + '@babel/runtime': 7.26.7 + highlight.js: 10.7.3 + highlightjs-vue: 1.0.0 + lowlight: 1.20.0 + prismjs: 1.30.0 + react: 19.0.0-rc-a7d1240c-20240731 + refractor: 3.6.0 + react-textarea-autosize@8.5.3(@types/react@18.3.5): dependencies: '@babel/runtime': 7.26.7 @@ -19072,6 +19474,12 @@ snapshots: globalthis: 1.0.4 which-builtin-type: 1.1.3 + refractor@3.6.0: + dependencies: + hastscript: 6.0.0 + parse-entities: 2.0.0 + prismjs: 1.27.0 + regenerator-runtime@0.14.1: {} regexp.prototype.flags@1.5.2: @@ -19321,7 +19729,7 @@ snapshots: router@2.2.0: dependencies: - debug: 4.4.0 + debug: 4.4.3 depd: 2.0.0 is-promise: 4.0.0 parseurl: 1.3.3 @@ -19430,7 +19838,7 @@ snapshots: send@1.2.0: dependencies: - debug: 4.4.0 + debug: 4.4.3 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 @@ -19652,6 +20060,8 @@ snapshots: source-map@0.7.4: {} + space-separated-tokens@1.1.5: {} + space-separated-tokens@2.0.2: {} spawn-command@0.0.2: {} @@ -19798,7 +20208,7 @@ snapshots: strip-json-comments@3.1.1: {} - strip-literal@3.0.0: + strip-literal@3.1.0: dependencies: js-tokens: 9.0.1 @@ -19819,7 +20229,7 @@ snapshots: stylus@0.62.0: dependencies: '@adobe/css-tools': 4.3.3 - debug: 4.4.0 + debug: 4.4.3 glob: 7.2.3 sax: 1.3.0 source-map: 0.7.4 @@ -19844,7 +20254,7 @@ snapshots: dependencies: component-emitter: 1.3.1 cookiejar: 2.1.4 - debug: 4.4.0 + debug: 4.4.1 fast-safe-stringify: 2.1.1 form-data: 4.0.1 formidable: 3.5.2 @@ -20019,11 +20429,16 @@ snapshots: fdir: 6.4.6(picomatch@4.0.3) picomatch: 4.0.3 + tinyglobby@0.2.15: + dependencies: + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + tinypool@1.1.1: {} tinyrainbow@2.0.0: {} - tinyspy@4.0.3: {} + tinyspy@4.0.4: {} tippy.js@6.3.7: dependencies: @@ -20452,7 +20867,7 @@ snapshots: vite-node@3.2.4(@types/node@20.17.11)(esbuild@0.25.1)(jiti@2.4.2)(less@4.2.0)(sass@1.86.0)(stylus@0.62.0)(terser@5.37.0)(yaml@2.5.0): dependencies: cac: 6.7.14 - debug: 4.4.1 + debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 vite: rolldown-vite@7.0.3(@types/node@20.17.11)(esbuild@0.25.1)(jiti@2.4.2)(less@4.2.0)(sass@1.86.0)(stylus@0.62.0)(terser@5.37.0)(yaml@2.5.0) @@ -20490,16 +20905,16 @@ snapshots: '@vitest/snapshot': 3.2.4 '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 - chai: 5.2.0 - debug: 4.4.1 - expect-type: 1.2.1 - magic-string: 0.30.17 + chai: 5.3.3 + debug: 4.4.3 + expect-type: 1.2.2 + magic-string: 0.30.19 pathe: 2.0.3 - picomatch: 4.0.2 + picomatch: 4.0.3 std-env: 3.9.0 tinybench: 2.9.0 tinyexec: 0.3.2 - tinyglobby: 0.2.14 + tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 vite: rolldown-vite@7.0.3(@types/node@20.17.11)(esbuild@0.25.1)(jiti@2.4.2)(less@4.2.0)(sass@1.86.0)(stylus@0.62.0)(terser@5.37.0)(yaml@2.5.0) @@ -20563,7 +20978,7 @@ snapshots: browserslist: 4.25.1 chrome-trace-event: 1.0.4 enhanced-resolve: 5.18.0 - es-module-lexer: 1.6.0 + es-module-lexer: 1.7.0 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 @@ -20593,7 +21008,7 @@ snapshots: browserslist: 4.25.1 chrome-trace-event: 1.0.4 enhanced-resolve: 5.18.0 - es-module-lexer: 1.6.0 + es-module-lexer: 1.7.0 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 diff --git a/test/__test__/apps/react-syntax-highlighter.spec.mjs b/test/__test__/apps/react-syntax-highlighter.spec.mjs new file mode 100644 index 00000000..afc6b51f --- /dev/null +++ b/test/__test__/apps/react-syntax-highlighter.spec.mjs @@ -0,0 +1,32 @@ +import { join } from "node:path"; + +import { hostname, page, server, waitForHydration } from "playground/utils"; +import { expect, test } from "vitest"; + +process.chdir(join(process.cwd(), "../examples/react-syntax-highlighter")); + +test("react-syntax-highlighter load", async () => { + await server("./App.jsx"); + await page.goto(hostname); + await page.waitForLoadState("networkidle"); + await waitForHydration(); + + await page + .getByText("react-syntax-highlighter") + .waitFor({ state: "visible" }); + expect(await page.getByText("react-syntax-highlighter").isVisible()).toBe( + true + ); + + const serverCode = page.getByText( + "import { createServer } from 'react-server';" + ); + await serverCode.waitFor({ state: "visible" }); + expect(await serverCode.isVisible()).toBe(true); + + const clientCode = page.getByText( + "import { Link } from '@lazarv/react-server/navigation';" + ); + await clientCode.waitFor({ state: "visible" }); + expect(await clientCode.isVisible()).toBe(true); +}); diff --git a/test/vitestSetup.mjs b/test/vitestSetup.mjs index aeefd4c4..e907b57f 100644 --- a/test/vitestSetup.mjs +++ b/test/vitestSetup.mjs @@ -34,6 +34,36 @@ const BASE_PORT = 3000; const MAX_PORT = 32767; let portCounter = 0; +async function cleanup() { + try { + if (!process.env.CI && testCwd !== process.cwd()) { + const files = [ + ...(await readdir(process.cwd(), { withFileTypes: true })), + ...(await readdir(join(process.cwd(), "node_modules"), { + withFileTypes: true, + })), + ]; + await Promise.all( + files + .filter( + (file) => file.isDirectory() && file.name.includes(".react-server") + ) + .map(async (file) => { + try { + return await rm(join(file.parentPath, file.name), { + recursive: true, + }); + } catch { + // ignore + } + }) + ); + } + } catch { + // ignore + } +} + beforeAll(async ({ name, id }) => { const wsEndpoint = inject("wsEndpoint"); browser = await chromium.connect(wsEndpoint); @@ -44,6 +74,7 @@ beforeAll(async ({ name, id }) => { server = (root, initialConfig) => new Promise(async (resolve, reject) => { try { + await cleanup(); logs = []; serverLogs = []; const hashValue = createHash("sha256") @@ -162,15 +193,5 @@ afterEach(async () => { afterAll(async () => { await page?.close(); await browser?.close(); - - if (!process.env.CI && testCwd !== process.cwd()) { - const files = await readdir(process.cwd(), { withFileTypes: true }); - await Promise.all( - files - .filter( - (file) => file.isDirectory() && file.name.includes(".react-server") - ) - .map((file) => rm(join(process.cwd(), file.name), { recursive: true })) - ); - } + await cleanup(); }); From 604d3f1978a834c46a7ba3f73ce25336578d2105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20L=C3=A1z=C3=A1r?= Date: Mon, 6 Oct 2025 22:41:38 +0200 Subject: [PATCH 2/3] fix: test cleanup --- test/vitestSetup.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/vitestSetup.mjs b/test/vitestSetup.mjs index e907b57f..846d84c0 100644 --- a/test/vitestSetup.mjs +++ b/test/vitestSetup.mjs @@ -74,7 +74,6 @@ beforeAll(async ({ name, id }) => { server = (root, initialConfig) => new Promise(async (resolve, reject) => { try { - await cleanup(); logs = []; serverLogs = []; const hashValue = createHash("sha256") From 2880061b37ba2208807976454d03f1e2067c586f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20L=C3=A1z=C3=A1r?= Date: Mon, 6 Oct 2025 23:37:24 +0200 Subject: [PATCH 3/3] fix: win32 hljs styles alias --- packages/react-server/lib/dev/create-server.mjs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/react-server/lib/dev/create-server.mjs b/packages/react-server/lib/dev/create-server.mjs index a4171345..6f622e49 100644 --- a/packages/react-server/lib/dev/create-server.mjs +++ b/packages/react-server/lib/dev/create-server.mjs @@ -197,12 +197,9 @@ export default async function createServer(root, options) { }, { find: /^react-server-highlight\.js\/styles/, - replacement: sys.normalizePath( - dirname(__require.resolve("highlight.js/lib/core")).replace( - "/lib", - "/styles" - ) - ), + replacement: sys + .normalizePath(dirname(__require.resolve("highlight.js/lib/core"))) + .replace("/lib", "/styles"), }, { find: /^@jridgewell\/trace-mapping$/,