@scalar/server-side-rendering 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @scalar/server-side-rendering
2
2
 
3
+ ## 0.1.5
4
+
5
+ ## 0.1.4
6
+
7
+ ### Patch Changes
8
+
9
+ - [#8919](https://github.com/scalar/scalar/pull/8919): fix build externals so Node built-ins remain runtime imports in the SSR bundle
10
+
3
11
  ## 0.1.3
4
12
 
5
13
  ### Patch Changes
package/dist/ssr.js CHANGED
@@ -1,10 +1,11 @@
1
- import { require___vite_browser_external } from "./_virtual/__vite-browser-external.js";
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { createRequire } from "node:module";
3
+ import { dirname, resolve } from "node:path";
2
4
  import { ApiReference } from "@scalar/api-reference";
3
5
  import { createSSRApp, h } from "vue";
4
6
  import { renderToString } from "vue/server-renderer";
5
7
  //#region src/ssr.ts
6
- var import___vite_browser_external = require___vite_browser_external();
7
- var require = (0, import___vite_browser_external.createRequire)(import.meta.url);
8
+ var require = createRequire(import.meta.url);
8
9
  /**
9
10
  * Unwrap the configuration from an array if needed, since AnyApiReferenceConfiguration
10
11
  * can be a single config or an array of configs.
@@ -76,7 +77,7 @@ var _cachedCss;
76
77
  var _cachedJs;
77
78
  /** Read the built style.css from the @scalar/api-reference package. */
78
79
  function getDefaultCss() {
79
- if (_cachedCss === void 0) _cachedCss = (0, import___vite_browser_external.readFileSync)(require.resolve("@scalar/api-reference/style.css"), "utf-8");
80
+ if (_cachedCss === void 0) _cachedCss = readFileSync(require.resolve("@scalar/api-reference/style.css"), "utf-8");
80
81
  return _cachedCss;
81
82
  }
82
83
  /**
@@ -88,13 +89,13 @@ function getDefaultCss() {
88
89
  */
89
90
  function getJsAsset() {
90
91
  if (_cachedJs === void 0) {
91
- const apiReferencePackageRoot = (0, import___vite_browser_external.resolve)((0, import___vite_browser_external.dirname)(require.resolve("@scalar/api-reference")), "..");
92
- const apiReferencePackageJsonPath = (0, import___vite_browser_external.resolve)(apiReferencePackageRoot, "package.json");
93
- const apiReferencePackageJson = JSON.parse((0, import___vite_browser_external.readFileSync)(apiReferencePackageJsonPath, "utf-8"));
92
+ const apiReferencePackageRoot = resolve(dirname(require.resolve("@scalar/api-reference")), "..");
93
+ const apiReferencePackageJsonPath = resolve(apiReferencePackageRoot, "package.json");
94
+ const apiReferencePackageJson = JSON.parse(readFileSync(apiReferencePackageJsonPath, "utf-8"));
94
95
  if (typeof apiReferencePackageJson.browser !== "string" || apiReferencePackageJson.browser.length === 0) throw new Error(`Could not resolve @scalar/api-reference browser entry from "${apiReferencePackageJsonPath}". Expected a string "browser" field in package.json.`);
95
- const jsPath = (0, import___vite_browser_external.resolve)(apiReferencePackageRoot, apiReferencePackageJson.browser);
96
- if (!(0, import___vite_browser_external.existsSync)(jsPath)) throw new Error(`Could not locate @scalar/api-reference standalone bundle at "${jsPath}". Run the package build before reading SSR assets.`);
97
- _cachedJs = (0, import___vite_browser_external.readFileSync)(jsPath, "utf-8");
96
+ const jsPath = resolve(apiReferencePackageRoot, apiReferencePackageJson.browser);
97
+ if (!existsSync(jsPath)) throw new Error(`Could not locate @scalar/api-reference standalone bundle at "${jsPath}". Run the package build before reading SSR assets.`);
98
+ _cachedJs = readFileSync(jsPath, "utf-8");
98
99
  }
99
100
  return _cachedJs;
100
101
  }
package/dist/ssr.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ssr.js","names":[],"sources":["../src/ssr.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, resolve } from 'node:path'\n\nimport { ApiReference } from '@scalar/api-reference'\nimport type { AnyApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { createSSRApp, h } from 'vue'\nimport { renderToString } from 'vue/server-renderer'\n\nconst require = createRequire(import.meta.url)\n\n/**\n * Unwrap the configuration from an array if needed, since AnyApiReferenceConfiguration\n * can be a single config or an array of configs.\n */\nfunction unwrapConfig(configuration: AnyApiReferenceConfiguration): Record<string, unknown> {\n const config = Array.isArray(configuration) ? configuration[0] : configuration\n return (config ?? {}) as Record<string, unknown>\n}\n\nfunction parseForceDarkModeState(config: Record<string, unknown>): 'dark' | 'light' | null {\n const forced = config.forceDarkModeState\n\n if (forced === 'dark' || forced === 'light') {\n return forced\n }\n\n return null\n}\n\nfunction parseDarkMode(config: Record<string, unknown>): boolean | null {\n return typeof config.darkMode === 'boolean' ? config.darkMode : null\n}\n\n/**\n * Generate an inline script that detects the user's color mode preference\n * and applies the correct class to <body> before content paints.\n *\n * Place this script before the app container in your HTML so it runs before\n * the first paint without interfering with Vue hydration.\n *\n * Priority:\n * 1. forceDarkModeState → always wins (no runtime detection)\n * 2. localStorage 'colorMode' → user's saved preference\n * 3. matchMedia system preference\n * 4. darkMode config → explicit default\n * 5. Fallback → light-mode\n */\nexport function generateBodyScript(configuration: AnyApiReferenceConfiguration): string {\n const config = unwrapConfig(configuration)\n const forced = parseForceDarkModeState(config)\n const darkMode = parseDarkMode(config)\n\n /** When forceDarkModeState is set, we do not need runtime detection at all. */\n if (forced) {\n return `<script>(function(){var cl=document.body.classList;cl.remove('dark-mode','light-mode');cl.add('${forced === 'dark' ? 'dark-mode' : 'light-mode'}')})()</script>`\n }\n\n /**\n * Runtime detection script: checks localStorage first, then system preference,\n * then falls back to the darkMode config value.\n */\n const fallback =\n darkMode === null ? `set(window.matchMedia('(prefers-color-scheme:dark)').matches)` : `set(${darkMode})`\n\n return `<script>(function(){var cl=document.body.classList;function set(d){cl.remove('dark-mode','light-mode');cl.add(d?'dark-mode':'light-mode')}try{var s=localStorage.getItem('colorMode');if(s==='dark'||s==='light'){set(s==='dark');return}}catch(e){}${fallback}})()</script>`\n}\n\n/**\n * Derive the initial SSR class for <body> from config.\n *\n * Priority:\n * 1. forceDarkModeState\n * 2. darkMode\n * 3. fallback to dark-mode (then runtime script can refine from localStorage/matchMedia)\n */\nfunction getInitialBodyClass(configuration: AnyApiReferenceConfiguration): 'dark-mode' | 'light-mode' {\n const config = unwrapConfig(configuration)\n const forced = parseForceDarkModeState(config)\n const darkMode = parseDarkMode(config)\n\n if (forced) {\n return forced === 'dark' ? 'dark-mode' : 'light-mode'\n }\n\n if (darkMode !== null) {\n return darkMode ? 'dark-mode' : 'light-mode'\n }\n\n return 'dark-mode'\n}\n\n/**\n * Render the Scalar API Reference to an HTML string for server-side rendering.\n * Use createApiReference on the client to hydrate the server-rendered output.\n *\n * Returns only the Vue-rendered HTML. Use generateBodyScript separately to get\n * the dark/light mode script — place it outside the app container so it does not\n * interfere with Vue hydration.\n */\nexport async function renderApiReferenceToString(configuration: AnyApiReferenceConfiguration): Promise<string> {\n const normalizedConfiguration = unwrapConfig(configuration)\n const app = createSSRApp(() => h(ApiReference, { configuration: normalizedConfiguration }))\n app.config.idPrefix = 'scalar-refs'\n\n return await renderToString(app)\n}\n\nlet _cachedCss: string | undefined\nlet _cachedJs: string | undefined\n\n/** Read the built style.css from the @scalar/api-reference package. */\nfunction getDefaultCss(): string {\n if (_cachedCss === undefined) {\n const cssPath = require.resolve('@scalar/api-reference/style.css')\n _cachedCss = readFileSync(cssPath, 'utf-8')\n }\n return _cachedCss\n}\n\n/**\n * Get the standalone JavaScript bundle as a string.\n *\n * Serve this at a route (e.g. `/scalar/scalar.js`) and pass the same path\n * as the `cdn` option to `renderApiReference`. The bundle handles client-side\n * hydration of the server-rendered HTML.\n */\nexport function getJsAsset(): string {\n if (_cachedJs === undefined) {\n const apiReferenceEntryPath = require.resolve('@scalar/api-reference')\n const apiReferencePackageRoot = resolve(dirname(apiReferenceEntryPath), '..')\n const apiReferencePackageJsonPath = resolve(apiReferencePackageRoot, 'package.json')\n const apiReferencePackageJson = JSON.parse(readFileSync(apiReferencePackageJsonPath, 'utf-8')) as {\n browser?: unknown\n }\n\n if (typeof apiReferencePackageJson.browser !== 'string' || apiReferencePackageJson.browser.length === 0) {\n throw new Error(\n `Could not resolve @scalar/api-reference browser entry from \"${apiReferencePackageJsonPath}\". ` +\n 'Expected a string \"browser\" field in package.json.',\n )\n }\n\n const jsPath = resolve(apiReferencePackageRoot, apiReferencePackageJson.browser)\n\n if (!existsSync(jsPath)) {\n throw new Error(\n `Could not locate @scalar/api-reference standalone bundle at \"${jsPath}\". Run the package build before reading SSR assets.`,\n )\n }\n\n _cachedJs = readFileSync(jsPath, 'utf-8')\n }\n return _cachedJs\n}\n\n/** Escape HTML special characters in user-provided strings. */\nfunction escapeHtml(str: string): string {\n return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')\n}\n\n/** Escape user-provided strings before inserting into HTML attributes. */\nfunction escapeHtmlAttribute(str: string): string {\n return escapeHtml(str).replace(/\"/g, '&quot;').replace(/'/g, '&#39;')\n}\n\n/**\n * Escape a JSON string so it is safe to embed inside an inline script tag.\n * This prevents user content from closing the script tag.\n */\nfunction escapeJsonForInlineScript(json: string): string {\n return json\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/&/g, '\\\\u0026')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n}\n\n/**\n * Escape a function's source code so it is safe to embed inside an inline script tag.\n *\n * Unlike escapeJsonForInlineScript (which escapes all `<` and `>`), this only neutralizes\n * sequences that could break out of a `<script>` block or open an HTML comment:\n * - `</` (case-insensitive closing tags, e.g. `</script>`)\n * - `<!--` (HTML comment open)\n * - U+2028 / U+2029 (line/paragraph separators, invalid in JS source outside strings)\n *\n * This preserves JS syntax like `=>`, `<`, `>`, and `>=`.\n */\nfunction escapeFunctionSourceForInlineScript(source: string): string {\n return source\n .replace(/<\\//g, '<\\\\/')\n .replace(/<!--/g, '<\\\\!--')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n}\n\n/** Add consistent indentation to multiline strings embedded in HTML output. */\nconst addIndent = (str: string, spaces: number = 2, initialIndent: boolean = false): string => {\n const indent = ' '.repeat(spaces)\n const lines = str.split('\\n')\n\n return lines\n .map((line, index) => {\n if (index === 0 && !initialIndent) {\n return line\n }\n\n return `${indent}${line}`\n })\n .join('\\n')\n}\n\n/**\n * Reject function values that would otherwise be silently dropped by JSON.stringify.\n * SSR only supports top-level function props and top-level arrays containing functions,\n * matching the client-side renderer behavior.\n */\nconst assertNoNestedFunctions = (value: unknown, path: string): void => {\n if (typeof value === 'function') {\n throw new Error(\n `Cannot serialize function at \"${path}\" for SSR hydration. ` +\n 'Only top-level function properties and top-level arrays containing functions are supported.',\n )\n }\n\n if (Array.isArray(value)) {\n value.forEach((item, index) => assertNoNestedFunctions(item, `${path}[${index}]`))\n return\n }\n\n if (value && typeof value === 'object') {\n Object.entries(value).forEach(([key, nestedValue]) => assertNoNestedFunctions(nestedValue, `${path}.${key}`))\n }\n}\n\nconst serializeJsonValue = (value: unknown): string => escapeJsonForInlineScript(JSON.stringify(value))\n\nconst serializeJsonObject = (value: Record<string, unknown>): string =>\n escapeJsonForInlineScript(JSON.stringify(value, null, 2))\n\nconst serializePropertyKey = (key: string): string => escapeJsonForInlineScript(JSON.stringify(key))\n\nconst serializeArrayWithFunctions = (value: unknown[], path: string): string => {\n return `[${value\n .map((item, index) => {\n if (typeof item === 'function') {\n return escapeFunctionSourceForInlineScript(item.toString())\n }\n\n assertNoNestedFunctions(item, `${path}[${index}]`)\n return serializeJsonValue(item)\n })\n .join(', ')}]`\n}\n\nconst serializeFunctionProperty = (key: string, value: Function): string =>\n `${serializePropertyKey(key)}: ${escapeFunctionSourceForInlineScript(value.toString())}`\n\nconst serializeArrayProperty = (key: string, value: unknown[]): string =>\n `${serializePropertyKey(key)}: ${serializeArrayWithFunctions(value, key)}`\n\nconst mergeSerializedProperties = (jsonObjectLiteral: string, dynamicProperties: string[]): string => {\n const formattedDynamicProperties = addIndent(dynamicProperties.join(',\\n'), 8, true)\n\n if (jsonObjectLiteral === '{}') {\n return `{\\n${formattedDynamicProperties}\\n }`\n }\n\n const jsonWithoutClosingBrace = jsonObjectLiteral.split('\\n').slice(0, -1).join('\\n')\n return `${jsonWithoutClosingBrace},\\n${formattedDynamicProperties}\\n }`\n}\n\n/**\n * Serialize a configuration object to a JavaScript object literal for hydration.\n * Top-level function props and top-level arrays containing functions are preserved\n * to match the client-side renderer behavior.\n */\nexport function serializeConfigToJs(config: Record<string, unknown>): string {\n const restConfig = { ...config }\n const dynamicProperties: string[] = []\n\n Object.entries(config).forEach(([key, value]) => {\n if (typeof value === 'function') {\n dynamicProperties.push(serializeFunctionProperty(key, value))\n delete restConfig[key]\n return\n }\n\n if (Array.isArray(value) && value.some((item) => typeof item === 'function')) {\n dynamicProperties.push(serializeArrayProperty(key, value))\n delete restConfig[key]\n return\n }\n\n assertNoNestedFunctions(value, key)\n })\n\n const jsonString = serializeJsonObject(restConfig)\n const indentedJsonString = addIndent(jsonString, 6)\n\n if (dynamicProperties.length === 0) {\n return indentedJsonString\n }\n\n return mergeSerializedProperties(indentedJsonString, dynamicProperties)\n}\n\n/**\n * Render the Scalar API Reference as a complete HTML document with client-side\n * hydration.\n *\n * Returns a full `<!doctype html>` page with:\n * - Inline CSS in `<head>` (prevents flash of unstyled content)\n * - Color-mode detection script (runs before first paint)\n * - Pre-rendered Vue HTML (immediate content, no blank page)\n * - Script tags to load the standalone bundle and hydrate\n *\n * Serve the standalone JS bundle via `getJsAsset()` at the route matching\n * the `cdn` option (defaults to `/scalar/scalar.js`).\n */\nexport async function renderApiReference(options: {\n /** The API reference configuration. */\n config: AnyApiReferenceConfiguration\n /** Page title. Defaults to \"Scalar API Reference\". */\n pageTitle?: string\n /** Override the built-in CSS. */\n css?: string\n /** URL path to the standalone JS bundle. Defaults to \"/scalar/scalar.js\". */\n cdn?: string\n}): Promise<string> {\n const title = escapeHtml(options.pageTitle ?? 'Scalar API Reference')\n const css = options.css ?? getDefaultCss()\n const cdn = escapeHtmlAttribute(options.cdn ?? '/scalar/scalar.js')\n const html = await renderApiReferenceToString(options.config)\n const bodyScript = generateBodyScript(options.config)\n const initialBodyClass = getInitialBodyClass(options.config)\n const configJs = serializeConfigToJs(unwrapConfig(options.config))\n\n return `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>${title}</title>\n <style>${css}</style>\n </head>\n <body class=\"${initialBodyClass}\">\n ${bodyScript}\n <div id=\"app\">${html}</div>\n <script src=\"${cdn}\"></script>\n <script>Scalar.createApiReference('#app', ${configJs})</script>\n </body>\n</html>`\n}\n"],"mappings":";;;;;;AASA,IAAM,WAAA,GAAA,+BAAA,eAAwB,OAAO,KAAK,IAAI;;;;;AAM9C,SAAS,aAAa,eAAsE;AAE1F,SADe,MAAM,QAAQ,cAAc,GAAG,cAAc,KAAK,kBAC/C,EAAE;;AAGtB,SAAS,wBAAwB,QAA0D;CACzF,MAAM,SAAS,OAAO;AAEtB,KAAI,WAAW,UAAU,WAAW,QAClC,QAAO;AAGT,QAAO;;AAGT,SAAS,cAAc,QAAiD;AACtE,QAAO,OAAO,OAAO,aAAa,YAAY,OAAO,WAAW;;;;;;;;;;;;;;;;AAiBlE,SAAgB,mBAAmB,eAAqD;CACtF,MAAM,SAAS,aAAa,cAAc;CAC1C,MAAM,SAAS,wBAAwB,OAAO;CAC9C,MAAM,WAAW,cAAc,OAAO;;AAGtC,KAAI,OACF,QAAO,kGAAkG,WAAW,SAAS,cAAc,aAAa;AAU1J,QAAO,uPAFL,aAAa,OAAO,kEAAkE,OAAO,SAAS,GAE+J;;;;;;;;;;AAWzQ,SAAS,oBAAoB,eAAyE;CACpG,MAAM,SAAS,aAAa,cAAc;CAC1C,MAAM,SAAS,wBAAwB,OAAO;CAC9C,MAAM,WAAW,cAAc,OAAO;AAEtC,KAAI,OACF,QAAO,WAAW,SAAS,cAAc;AAG3C,KAAI,aAAa,KACf,QAAO,WAAW,cAAc;AAGlC,QAAO;;;;;;;;;;AAWT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QAAQ,OAAO,eAAe;CAC1C,MAAM,MAAM,oBAAoB,QAAQ,OAAO,oBAAoB;CACnE,MAAM,OAAO,MAAM,2BAA2B,QAAQ,OAAO;CAC7D,MAAM,aAAa,mBAAmB,QAAQ,OAAO;AAIrD,QAAO;;;;;aAKI,MAAM;aACN,IAAI;;iBATU,oBAAoB,QAAQ,OAAO,CAW5B;MAC5B,WAAW;oBACG,KAAK;mBACN,IAAI;gDAbJ,oBAAoB,aAAa,QAAQ,OAAO,CAAC,CAcX"}
1
+ {"version":3,"file":"ssr.js","names":[],"sources":["../src/ssr.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, resolve } from 'node:path'\n\nimport { ApiReference } from '@scalar/api-reference'\nimport type { AnyApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { createSSRApp, h } from 'vue'\nimport { renderToString } from 'vue/server-renderer'\n\nconst require = createRequire(import.meta.url)\n\n/**\n * Unwrap the configuration from an array if needed, since AnyApiReferenceConfiguration\n * can be a single config or an array of configs.\n */\nfunction unwrapConfig(configuration: AnyApiReferenceConfiguration): Record<string, unknown> {\n const config = Array.isArray(configuration) ? configuration[0] : configuration\n return (config ?? {}) as Record<string, unknown>\n}\n\nfunction parseForceDarkModeState(config: Record<string, unknown>): 'dark' | 'light' | null {\n const forced = config.forceDarkModeState\n\n if (forced === 'dark' || forced === 'light') {\n return forced\n }\n\n return null\n}\n\nfunction parseDarkMode(config: Record<string, unknown>): boolean | null {\n return typeof config.darkMode === 'boolean' ? config.darkMode : null\n}\n\n/**\n * Generate an inline script that detects the user's color mode preference\n * and applies the correct class to <body> before content paints.\n *\n * Place this script before the app container in your HTML so it runs before\n * the first paint without interfering with Vue hydration.\n *\n * Priority:\n * 1. forceDarkModeState → always wins (no runtime detection)\n * 2. localStorage 'colorMode' → user's saved preference\n * 3. matchMedia system preference\n * 4. darkMode config → explicit default\n * 5. Fallback → light-mode\n */\nexport function generateBodyScript(configuration: AnyApiReferenceConfiguration): string {\n const config = unwrapConfig(configuration)\n const forced = parseForceDarkModeState(config)\n const darkMode = parseDarkMode(config)\n\n /** When forceDarkModeState is set, we do not need runtime detection at all. */\n if (forced) {\n return `<script>(function(){var cl=document.body.classList;cl.remove('dark-mode','light-mode');cl.add('${forced === 'dark' ? 'dark-mode' : 'light-mode'}')})()</script>`\n }\n\n /**\n * Runtime detection script: checks localStorage first, then system preference,\n * then falls back to the darkMode config value.\n */\n const fallback =\n darkMode === null ? `set(window.matchMedia('(prefers-color-scheme:dark)').matches)` : `set(${darkMode})`\n\n return `<script>(function(){var cl=document.body.classList;function set(d){cl.remove('dark-mode','light-mode');cl.add(d?'dark-mode':'light-mode')}try{var s=localStorage.getItem('colorMode');if(s==='dark'||s==='light'){set(s==='dark');return}}catch(e){}${fallback}})()</script>`\n}\n\n/**\n * Derive the initial SSR class for <body> from config.\n *\n * Priority:\n * 1. forceDarkModeState\n * 2. darkMode\n * 3. fallback to dark-mode (then runtime script can refine from localStorage/matchMedia)\n */\nfunction getInitialBodyClass(configuration: AnyApiReferenceConfiguration): 'dark-mode' | 'light-mode' {\n const config = unwrapConfig(configuration)\n const forced = parseForceDarkModeState(config)\n const darkMode = parseDarkMode(config)\n\n if (forced) {\n return forced === 'dark' ? 'dark-mode' : 'light-mode'\n }\n\n if (darkMode !== null) {\n return darkMode ? 'dark-mode' : 'light-mode'\n }\n\n return 'dark-mode'\n}\n\n/**\n * Render the Scalar API Reference to an HTML string for server-side rendering.\n * Use createApiReference on the client to hydrate the server-rendered output.\n *\n * Returns only the Vue-rendered HTML. Use generateBodyScript separately to get\n * the dark/light mode script — place it outside the app container so it does not\n * interfere with Vue hydration.\n */\nexport async function renderApiReferenceToString(configuration: AnyApiReferenceConfiguration): Promise<string> {\n const normalizedConfiguration = unwrapConfig(configuration)\n const app = createSSRApp(() => h(ApiReference, { configuration: normalizedConfiguration }))\n app.config.idPrefix = 'scalar-refs'\n\n return await renderToString(app)\n}\n\nlet _cachedCss: string | undefined\nlet _cachedJs: string | undefined\n\n/** Read the built style.css from the @scalar/api-reference package. */\nfunction getDefaultCss(): string {\n if (_cachedCss === undefined) {\n const cssPath = require.resolve('@scalar/api-reference/style.css')\n _cachedCss = readFileSync(cssPath, 'utf-8')\n }\n return _cachedCss\n}\n\n/**\n * Get the standalone JavaScript bundle as a string.\n *\n * Serve this at a route (e.g. `/scalar/scalar.js`) and pass the same path\n * as the `cdn` option to `renderApiReference`. The bundle handles client-side\n * hydration of the server-rendered HTML.\n */\nexport function getJsAsset(): string {\n if (_cachedJs === undefined) {\n const apiReferenceEntryPath = require.resolve('@scalar/api-reference')\n const apiReferencePackageRoot = resolve(dirname(apiReferenceEntryPath), '..')\n const apiReferencePackageJsonPath = resolve(apiReferencePackageRoot, 'package.json')\n const apiReferencePackageJson = JSON.parse(readFileSync(apiReferencePackageJsonPath, 'utf-8')) as {\n browser?: unknown\n }\n\n if (typeof apiReferencePackageJson.browser !== 'string' || apiReferencePackageJson.browser.length === 0) {\n throw new Error(\n `Could not resolve @scalar/api-reference browser entry from \"${apiReferencePackageJsonPath}\". ` +\n 'Expected a string \"browser\" field in package.json.',\n )\n }\n\n const jsPath = resolve(apiReferencePackageRoot, apiReferencePackageJson.browser)\n\n if (!existsSync(jsPath)) {\n throw new Error(\n `Could not locate @scalar/api-reference standalone bundle at \"${jsPath}\". Run the package build before reading SSR assets.`,\n )\n }\n\n _cachedJs = readFileSync(jsPath, 'utf-8')\n }\n return _cachedJs\n}\n\n/** Escape HTML special characters in user-provided strings. */\nfunction escapeHtml(str: string): string {\n return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')\n}\n\n/** Escape user-provided strings before inserting into HTML attributes. */\nfunction escapeHtmlAttribute(str: string): string {\n return escapeHtml(str).replace(/\"/g, '&quot;').replace(/'/g, '&#39;')\n}\n\n/**\n * Escape a JSON string so it is safe to embed inside an inline script tag.\n * This prevents user content from closing the script tag.\n */\nfunction escapeJsonForInlineScript(json: string): string {\n return json\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/&/g, '\\\\u0026')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n}\n\n/**\n * Escape a function's source code so it is safe to embed inside an inline script tag.\n *\n * Unlike escapeJsonForInlineScript (which escapes all `<` and `>`), this only neutralizes\n * sequences that could break out of a `<script>` block or open an HTML comment:\n * - `</` (case-insensitive closing tags, e.g. `</script>`)\n * - `<!--` (HTML comment open)\n * - U+2028 / U+2029 (line/paragraph separators, invalid in JS source outside strings)\n *\n * This preserves JS syntax like `=>`, `<`, `>`, and `>=`.\n */\nfunction escapeFunctionSourceForInlineScript(source: string): string {\n return source\n .replace(/<\\//g, '<\\\\/')\n .replace(/<!--/g, '<\\\\!--')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n}\n\n/** Add consistent indentation to multiline strings embedded in HTML output. */\nconst addIndent = (str: string, spaces: number = 2, initialIndent: boolean = false): string => {\n const indent = ' '.repeat(spaces)\n const lines = str.split('\\n')\n\n return lines\n .map((line, index) => {\n if (index === 0 && !initialIndent) {\n return line\n }\n\n return `${indent}${line}`\n })\n .join('\\n')\n}\n\n/**\n * Reject function values that would otherwise be silently dropped by JSON.stringify.\n * SSR only supports top-level function props and top-level arrays containing functions,\n * matching the client-side renderer behavior.\n */\nconst assertNoNestedFunctions = (value: unknown, path: string): void => {\n if (typeof value === 'function') {\n throw new Error(\n `Cannot serialize function at \"${path}\" for SSR hydration. ` +\n 'Only top-level function properties and top-level arrays containing functions are supported.',\n )\n }\n\n if (Array.isArray(value)) {\n value.forEach((item, index) => assertNoNestedFunctions(item, `${path}[${index}]`))\n return\n }\n\n if (value && typeof value === 'object') {\n Object.entries(value).forEach(([key, nestedValue]) => assertNoNestedFunctions(nestedValue, `${path}.${key}`))\n }\n}\n\nconst serializeJsonValue = (value: unknown): string => escapeJsonForInlineScript(JSON.stringify(value))\n\nconst serializeJsonObject = (value: Record<string, unknown>): string =>\n escapeJsonForInlineScript(JSON.stringify(value, null, 2))\n\nconst serializePropertyKey = (key: string): string => escapeJsonForInlineScript(JSON.stringify(key))\n\nconst serializeArrayWithFunctions = (value: unknown[], path: string): string => {\n return `[${value\n .map((item, index) => {\n if (typeof item === 'function') {\n return escapeFunctionSourceForInlineScript(item.toString())\n }\n\n assertNoNestedFunctions(item, `${path}[${index}]`)\n return serializeJsonValue(item)\n })\n .join(', ')}]`\n}\n\nconst serializeFunctionProperty = (key: string, value: Function): string =>\n `${serializePropertyKey(key)}: ${escapeFunctionSourceForInlineScript(value.toString())}`\n\nconst serializeArrayProperty = (key: string, value: unknown[]): string =>\n `${serializePropertyKey(key)}: ${serializeArrayWithFunctions(value, key)}`\n\nconst mergeSerializedProperties = (jsonObjectLiteral: string, dynamicProperties: string[]): string => {\n const formattedDynamicProperties = addIndent(dynamicProperties.join(',\\n'), 8, true)\n\n if (jsonObjectLiteral === '{}') {\n return `{\\n${formattedDynamicProperties}\\n }`\n }\n\n const jsonWithoutClosingBrace = jsonObjectLiteral.split('\\n').slice(0, -1).join('\\n')\n return `${jsonWithoutClosingBrace},\\n${formattedDynamicProperties}\\n }`\n}\n\n/**\n * Serialize a configuration object to a JavaScript object literal for hydration.\n * Top-level function props and top-level arrays containing functions are preserved\n * to match the client-side renderer behavior.\n */\nexport function serializeConfigToJs(config: Record<string, unknown>): string {\n const restConfig = { ...config }\n const dynamicProperties: string[] = []\n\n Object.entries(config).forEach(([key, value]) => {\n if (typeof value === 'function') {\n dynamicProperties.push(serializeFunctionProperty(key, value))\n delete restConfig[key]\n return\n }\n\n if (Array.isArray(value) && value.some((item) => typeof item === 'function')) {\n dynamicProperties.push(serializeArrayProperty(key, value))\n delete restConfig[key]\n return\n }\n\n assertNoNestedFunctions(value, key)\n })\n\n const jsonString = serializeJsonObject(restConfig)\n const indentedJsonString = addIndent(jsonString, 6)\n\n if (dynamicProperties.length === 0) {\n return indentedJsonString\n }\n\n return mergeSerializedProperties(indentedJsonString, dynamicProperties)\n}\n\n/**\n * Render the Scalar API Reference as a complete HTML document with client-side\n * hydration.\n *\n * Returns a full `<!doctype html>` page with:\n * - Inline CSS in `<head>` (prevents flash of unstyled content)\n * - Color-mode detection script (runs before first paint)\n * - Pre-rendered Vue HTML (immediate content, no blank page)\n * - Script tags to load the standalone bundle and hydrate\n *\n * Serve the standalone JS bundle via `getJsAsset()` at the route matching\n * the `cdn` option (defaults to `/scalar/scalar.js`).\n */\nexport async function renderApiReference(options: {\n /** The API reference configuration. */\n config: AnyApiReferenceConfiguration\n /** Page title. Defaults to \"Scalar API Reference\". */\n pageTitle?: string\n /** Override the built-in CSS. */\n css?: string\n /** URL path to the standalone JS bundle. Defaults to \"/scalar/scalar.js\". */\n cdn?: string\n}): Promise<string> {\n const title = escapeHtml(options.pageTitle ?? 'Scalar API Reference')\n const css = options.css ?? getDefaultCss()\n const cdn = escapeHtmlAttribute(options.cdn ?? '/scalar/scalar.js')\n const html = await renderApiReferenceToString(options.config)\n const bodyScript = generateBodyScript(options.config)\n const initialBodyClass = getInitialBodyClass(options.config)\n const configJs = serializeConfigToJs(unwrapConfig(options.config))\n\n return `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>${title}</title>\n <style>${css}</style>\n </head>\n <body class=\"${initialBodyClass}\">\n ${bodyScript}\n <div id=\"app\">${html}</div>\n <script src=\"${cdn}\"></script>\n <script>Scalar.createApiReference('#app', ${configJs})</script>\n </body>\n</html>`\n}\n"],"mappings":";;;;;;;AASA,IAAM,UAAU,cAAc,OAAO,KAAK,IAAI;;;;;AAM9C,SAAS,aAAa,eAAsE;AAE1F,SADe,MAAM,QAAQ,cAAc,GAAG,cAAc,KAAK,kBAC/C,EAAE;;AAGtB,SAAS,wBAAwB,QAA0D;CACzF,MAAM,SAAS,OAAO;AAEtB,KAAI,WAAW,UAAU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U,YAAY;AAC/B,qBAAkB,KAAK,0BAA0B,KAAK,MAAM,CAAC;AAC7D,UAAO,WAAW;AAClB;;AAGF,MAAI,MAAM,QAAQ,MAAM,IAAI,MAAM,MAAM,SAAS,OAAO,SAAS,WAAW,EAAE;AAC5E,qBAAkB,KAAK,uBAAuB,KAAK,MAAM,CAAC;AAC1D,UAAO,WAAW;AAClB;;AAGF,0BAAwB,OAAO,IAAI;GACnC;CAGF,MAAM,qBAAqB,UADR,oBAAoB,WAAW,EACD,EAAE;AAEnD,KAAI,kBAAkB,WAAW,EAC/B,QAAO;AAGT,QAAO,0BAA0B,oBAAoB,kBAAkB;;;;;;;;;;;;;;;AAgBzE,eAAsB,mBAAmB,SASrB;CAClB,MAAM,QAAQ,WAAW,QAAQ,aAAa,uBAAuB;CACrE,MAAM,MAAM,QAAQ,OAAO,eAAe;CAC1C,MAAM,MAAM,oBAAoB,QAAQ,OAAO,oBAAoB;CACnE,MAAM,OAAO,MAAM,2BAA2B,QAAQ,OAAO;CAC7D,MAAM,aAAa,mBAAmB,QAAQ,OAAO;AAIrD,QAAO;;;;;aAKI,MAAM;aACN,IAAI;;iBATU,oBAAoB,QAAQ,OAAO,CAW5B;MAC5B,WAAW;oBACG,KAAK;mBACN,IAAI;gDAbJ,oBAAoB,aAAa,QAAQ,OAAO,CAAC,CAcX"}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "directory": "packages/server-side-rendering"
12
12
  },
13
13
  "keywords": [],
14
- "version": "0.1.3",
14
+ "version": "0.1.5",
15
15
  "engines": {
16
16
  "node": ">=22"
17
17
  },
@@ -29,8 +29,8 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "vue": "^3.5.30",
32
- "@scalar/types": "0.9.1",
33
- "@scalar/api-reference": "1.52.3"
32
+ "@scalar/api-reference": "1.52.5",
33
+ "@scalar/types": "0.9.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@hono/node-server": "^1.19.10",
@@ -1,10 +0,0 @@
1
- import { __commonJSMin } from "./_rolldown/runtime.js";
2
- //#region __vite-browser-external
3
- var require___vite_browser_external = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
- module.exports = {};
5
- }));
6
- //#endregion
7
- export default require___vite_browser_external();
8
- export { require___vite_browser_external };
9
-
10
- //# sourceMappingURL=__vite-browser-external.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"__vite-browser-external.js","names":[],"sources":["../../__vite-browser-external"],"sourcesContent":["module.exports = {}"],"mappings":";;;AAAA,QAAO,UAAU,EAAA"}
@@ -1,4 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3
- //#endregion
4
- export { __commonJSMin };