@blinkk/root 3.0.1 → 3.0.3

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.
Files changed (117) hide show
  1. package/dist/{chunk-FQBA5QSG.js → chunk-3Z5TNZEP.js} +3 -3
  2. package/dist/chunk-3Z5TNZEP.js.map +7 -0
  3. package/dist/{chunk-JCRXBB26.js → chunk-6NBKAR5Y.js} +2 -2
  4. package/dist/chunk-6NBKAR5Y.js.map +7 -0
  5. package/dist/chunk-6P3B7ZXL.js +1 -1
  6. package/dist/chunk-6P3B7ZXL.js.map +7 -1
  7. package/dist/{chunk-PVBPP5LN.js → chunk-7PSEEE6C.js} +10 -10
  8. package/dist/chunk-7PSEEE6C.js.map +7 -0
  9. package/dist/{chunk-M6WGW5VY.js → chunk-DU7JUEDY.js} +48 -6
  10. package/dist/chunk-DU7JUEDY.js.map +7 -0
  11. package/dist/{chunk-GSR74KEI.js → chunk-JTZWI4MH.js} +279 -73
  12. package/dist/chunk-JTZWI4MH.js.map +7 -0
  13. package/dist/{chunk-WAZTR3DX.js → chunk-KW7KTYGC.js} +2 -2
  14. package/dist/chunk-KW7KTYGC.js.map +7 -0
  15. package/dist/chunk-XSNCF7WU.js +1 -1
  16. package/dist/chunk-XSNCF7WU.js.map +7 -1
  17. package/dist/cli/build.d.ts +7 -0
  18. package/dist/cli/cli.d.ts +12 -0
  19. package/dist/cli/codegen.d.ts +5 -0
  20. package/dist/cli/create-package.d.ts +14 -0
  21. package/dist/cli/dev.d.ts +10 -0
  22. package/dist/cli/gae-deploy.d.ts +18 -0
  23. package/dist/cli/preview.d.ts +8 -0
  24. package/dist/cli/start.d.ts +8 -0
  25. package/dist/cli/startup/check-version.d.ts +17 -0
  26. package/dist/cli/startup/startup-tasks.d.ts +39 -0
  27. package/dist/cli.js +4 -4
  28. package/dist/cli.js.map +7 -1
  29. package/dist/core/components/Body.d.ts +23 -0
  30. package/dist/core/components/Head.d.ts +18 -0
  31. package/dist/core/components/Html.d.ts +24 -0
  32. package/dist/core/components/Script.d.ts +16 -0
  33. package/dist/core/config.d.ts +285 -0
  34. package/dist/core/core.d.ts +14 -0
  35. package/dist/core/hooks/useI18nContext.d.ts +11 -0
  36. package/dist/core/hooks/useRequestContext.d.ts +36 -0
  37. package/dist/core/hooks/useStringParams.d.ts +34 -0
  38. package/dist/core/hooks/useTranslations.d.ts +20 -0
  39. package/dist/core/hooks/useTranslationsMiddleware.d.ts +25 -0
  40. package/dist/core/pages/DevErrorPage.d.ts +9 -0
  41. package/dist/core/pages/DevNotFoundPage.d.ts +10 -0
  42. package/dist/core/pages/ErrorPage.d.ts +9 -0
  43. package/dist/core/plugin.d.ts +80 -0
  44. package/dist/core/pod.d.ts +54 -0
  45. package/dist/core/types.d.ts +228 -0
  46. package/dist/core.js +3 -3
  47. package/dist/core.js.map +7 -1
  48. package/dist/functions/functions.d.ts +1 -0
  49. package/dist/functions/server.d.ts +10 -0
  50. package/dist/functions.js +5 -5
  51. package/dist/functions.js.map +7 -1
  52. package/dist/jsx/jsx-dev-runtime.d.ts +10 -1
  53. package/dist/jsx/jsx-dev-runtime.js +2 -2
  54. package/dist/jsx/jsx-dev-runtime.js.map +7 -1
  55. package/dist/{jsx-C8BaDh-4.d.ts → jsx/jsx-render.d.ts} +3 -6
  56. package/dist/jsx/jsx-runtime.d.ts +120 -1
  57. package/dist/jsx/jsx-runtime.js +2 -2
  58. package/dist/jsx/jsx-runtime.js.map +7 -1
  59. package/dist/jsx/jsx.d.ts +37 -0
  60. package/dist/{jsx-dev-runtime-DUJrvx5P.d.ts → jsx/types.d.ts} +9 -125
  61. package/dist/jsx.js +3 -3
  62. package/dist/jsx.js.map +7 -1
  63. package/dist/middleware/common.d.ts +22 -0
  64. package/dist/middleware/hooks.d.ts +8 -0
  65. package/dist/middleware/middleware.d.ts +3 -0
  66. package/dist/middleware/multipart.d.ts +11 -0
  67. package/dist/middleware/redirects.d.ts +10 -0
  68. package/dist/middleware/session.d.ts +24 -0
  69. package/dist/middleware.js +2 -2
  70. package/dist/middleware.js.map +7 -1
  71. package/dist/node/element-graph.d.ts +51 -0
  72. package/dist/node/load-config.d.ts +17 -0
  73. package/dist/node/monorepo.d.ts +14 -0
  74. package/dist/node/node.d.ts +4 -0
  75. package/dist/node/pod-collector.d.ts +33 -0
  76. package/dist/node/pods-vite-plugin.d.ts +6 -0
  77. package/dist/node/vite-plugin-preact-alias.d.ts +10 -0
  78. package/dist/node/vite-plugin-prune-empty-chunks.d.ts +27 -0
  79. package/dist/node/vite-plugin-root-jsx-virtual.d.ts +16 -0
  80. package/dist/node/vite.d.ts +18 -0
  81. package/dist/node.js +2 -2
  82. package/dist/node.js.map +7 -1
  83. package/dist/render/accept-language.d.ts +8 -0
  84. package/dist/render/asset-map/asset-map.d.ts +25 -0
  85. package/dist/render/asset-map/build-asset-map.d.ts +47 -0
  86. package/dist/render/asset-map/dev-asset-map.d.ts +26 -0
  87. package/dist/render/countrie-language.d.ts +13 -0
  88. package/dist/render/html-minify.d.ts +3 -0
  89. package/dist/render/html-pretty.d.ts +3 -0
  90. package/dist/render/i18n-fallbacks.d.ts +11 -0
  91. package/dist/render/render.d.ts +91 -0
  92. package/dist/render/route-trie.d.ts +44 -0
  93. package/dist/render/router.d.ts +18 -0
  94. package/dist/render.js +9 -9
  95. package/dist/render.js.map +7 -1
  96. package/dist/utils/batch.d.ts +1 -0
  97. package/dist/utils/elements.d.ts +12 -0
  98. package/dist/utils/fsutils.d.ts +24 -0
  99. package/dist/utils/i18n.d.ts +8 -0
  100. package/dist/utils/ports.d.ts +8 -0
  101. package/dist/utils/rand.d.ts +10 -0
  102. package/dist/utils/url-path-params.d.ts +2 -0
  103. package/package.json +14 -15
  104. package/dist/chunk-FQBA5QSG.js.map +0 -1
  105. package/dist/chunk-GSR74KEI.js.map +0 -1
  106. package/dist/chunk-JCRXBB26.js.map +0 -1
  107. package/dist/chunk-M6WGW5VY.js.map +0 -1
  108. package/dist/chunk-PVBPP5LN.js.map +0 -1
  109. package/dist/chunk-WAZTR3DX.js.map +0 -1
  110. package/dist/cli.d.ts +0 -60
  111. package/dist/core.d.ts +0 -214
  112. package/dist/functions.d.ts +0 -14
  113. package/dist/jsx.d.ts +0 -2
  114. package/dist/middleware.d.ts +0 -43
  115. package/dist/node.d.ts +0 -91
  116. package/dist/render.d.ts +0 -8
  117. package/dist/types-Cksf99CK.d.ts +0 -827
@@ -0,0 +1,27 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * Vite plugin that removes 0-byte JS chunks from the build output and prunes
4
+ * the import statements that reference them.
5
+ *
6
+ * Tree-shaking (via rolldown/esbuild) can reduce a module to nothing — e.g. a
7
+ * type-only `.ts` file, or an entry whose contents are entirely eliminated.
8
+ * rolldown still emits a file for every explicit input, so these surface as
9
+ * 0-byte `.js` files in the build output. Worse, a sibling chunk may keep a
10
+ * bare side-effect import (`import "./<hash>.js"`) pointing at the empty file.
11
+ * If that empty file is removed without also removing the import, the import
12
+ * 404s at runtime and breaks the entire module graph.
13
+ *
14
+ * This plugin runs in `generateBundle` (before Vite's manifest plugin) and:
15
+ * 1. Detects chunks whose generated code is empty.
16
+ * 2. Skips any that still anchor CSS or asset references, so co-located
17
+ * styles are preserved (Vite keeps an empty JS chunk to carry the CSS
18
+ * link for a style-only module).
19
+ * 3. Strips bare side-effect imports of the empty chunks from sibling chunks.
20
+ * A 0-byte module exports nothing, so it can only be imported bare.
21
+ * 4. Deletes the empty chunks from the bundle.
22
+ *
23
+ * Because it runs before the manifest is emitted, the resulting
24
+ * `manifest.json` (consumed by Root's asset map) never references the removed
25
+ * files.
26
+ */
27
+ export declare function pruneEmptyChunksPlugin(): Plugin;
@@ -0,0 +1,16 @@
1
+ import type { Plugin } from 'vite';
2
+ export interface PreactToRootJsxPluginOptions {
3
+ /** Whether Root's JSX renderer mode is enabled. */
4
+ useRootJsx?: boolean;
5
+ }
6
+ /**
7
+ * Vite plugin that aliases `preact` imports to `@blinkk/root/jsx` in the SSR
8
+ * environment only.
9
+ *
10
+ * When `jsxRenderer.mode` is configured, the project uses Root's built-in JSX
11
+ * runtime instead of Preact for server-side rendering. This plugin redirects
12
+ * `preact` imports (`preact`, `preact/hooks`, `preact/jsx-runtime`, etc.) to
13
+ * Root's JSX package, but only in the SSR environment. Client-side code (e.g.
14
+ * islands that depend on real Preact for hydration) is left untouched.
15
+ */
16
+ export declare function preactToRootJsxPlugin(options?: PreactToRootJsxPluginOptions): Plugin;
@@ -0,0 +1,18 @@
1
+ import { ViteDevServer } from 'vite';
2
+ import { RootConfig } from '../core/config.js';
3
+ export interface CreateViteServerOptions {
4
+ /** Override HMR settings. */
5
+ hmr?: boolean;
6
+ /** The port the server will run on. */
7
+ port?: number;
8
+ /** List of files to include in the optimizeDeps.include config. */
9
+ optimizeDeps?: string[];
10
+ }
11
+ /**
12
+ * Returns a vite dev server.
13
+ */
14
+ export declare function createViteServer(rootConfig: RootConfig, options?: CreateViteServerOptions): Promise<ViteDevServer>;
15
+ /**
16
+ * Shortcut `viteServer.ssrLoadModule()` without starting an actual dev server.
17
+ */
18
+ export declare function viteSsrLoadModule<T = Record<string, any>>(rootConfig: RootConfig, file: string): Promise<T>;
package/dist/node.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  loadRootConfig,
11
11
  loadRootConfigWithDeps,
12
12
  viteSsrLoadModule
13
- } from "./chunk-PVBPP5LN.js";
13
+ } from "./chunk-7PSEEE6C.js";
14
14
  import "./chunk-XSNCF7WU.js";
15
15
  export {
16
16
  bundleRootConfig,
@@ -25,4 +25,4 @@ export {
25
25
  loadRootConfigWithDeps,
26
26
  viteSsrLoadModule
27
27
  };
28
- //# sourceMappingURL=node.js.map
28
+ //# sourceMappingURL=node.js.map
package/dist/node.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ export declare const ACCEPT_LANG_RE: RegExp;
2
+ export interface AcceptLanguage {
3
+ code: string;
4
+ script?: string;
5
+ region?: string;
6
+ quality: number;
7
+ }
8
+ export declare function parseAcceptLanguage(value: string): AcceptLanguage[];
@@ -0,0 +1,25 @@
1
+ export interface Asset {
2
+ /**
3
+ * The path to the asset's src file, relative to the project root.
4
+ */
5
+ src: string;
6
+ /**
7
+ * The serving URL for the asset.
8
+ */
9
+ assetUrl: string;
10
+ /**
11
+ * Recursively walks all deps and returns a list of CSS asset URLs.
12
+ */
13
+ getCssDeps(): Promise<string[]>;
14
+ /**
15
+ * Recursively walks all deps and returns a list of JS asset URLs.
16
+ */
17
+ getJsDeps(): Promise<string[]>;
18
+ }
19
+ export interface AssetMap {
20
+ /**
21
+ * Returns the asset for a given src file. The `src` value should be a path
22
+ * relative to the project root, e.g. "routes/index.tsx".
23
+ */
24
+ get: (src: string) => Promise<Asset | null>;
25
+ }
@@ -0,0 +1,47 @@
1
+ import { Manifest } from 'vite';
2
+ import { RootConfig } from '../../core/config.js';
3
+ import { ElementGraph } from '../../node/element-graph.js';
4
+ import { Asset, AssetMap } from './asset-map.js';
5
+ export type BuildAssetManifest = Record<string, {
6
+ src: string;
7
+ assetUrl: string;
8
+ importedModules: string[];
9
+ importedCss: string[];
10
+ isElement: boolean;
11
+ }>;
12
+ export declare class BuildAssetMap implements AssetMap {
13
+ private rootConfig;
14
+ private srcToAsset;
15
+ constructor(rootConfig: RootConfig);
16
+ get(src: string): Promise<Asset | null>;
17
+ private add;
18
+ toJson(): BuildAssetManifest;
19
+ static fromViteManifest(rootConfig: RootConfig, clientManifest: Manifest, elementsGraph: ElementGraph): BuildAssetMap;
20
+ static fromRootManifest(rootConfig: RootConfig, rootManifest: BuildAssetManifest): BuildAssetMap;
21
+ }
22
+ export declare class BuildAsset {
23
+ src: string;
24
+ assetUrl: string;
25
+ private assetMap;
26
+ private importedModules;
27
+ private importedCss;
28
+ isElement: boolean;
29
+ constructor(assetMap: BuildAssetMap, assetData: {
30
+ src: string;
31
+ assetUrl: string;
32
+ importedModules: string[];
33
+ importedCss: string[];
34
+ isElement: boolean;
35
+ });
36
+ getCssDeps(): Promise<string[]>;
37
+ getJsDeps(): Promise<string[]>;
38
+ private collectJs;
39
+ private collectCss;
40
+ toJson(): {
41
+ src: string;
42
+ assetUrl: string;
43
+ importedModules: string[];
44
+ importedCss: string[];
45
+ isElement: boolean;
46
+ };
47
+ }
@@ -0,0 +1,26 @@
1
+ import { ModuleGraph, ModuleNode } from 'vite';
2
+ import { RootConfig } from '../../core/config.js';
3
+ import { Asset, AssetMap } from './asset-map.js';
4
+ export declare class DevServerAssetMap implements AssetMap {
5
+ private rootConfig;
6
+ private moduleGraph;
7
+ constructor(rootConfig: RootConfig, moduleGraph: ModuleGraph);
8
+ get(src: string): Promise<Asset | null>;
9
+ filePathToSrc(file: string): string;
10
+ }
11
+ export declare class DevServerAsset implements Asset {
12
+ src: string;
13
+ moduleId: string;
14
+ assetUrl: string;
15
+ private assetMap;
16
+ private viteModule;
17
+ constructor(src: string, options: {
18
+ assetMap: DevServerAssetMap;
19
+ viteModule: ModuleNode;
20
+ });
21
+ getCssDeps(): Promise<string[]>;
22
+ getJsDeps(): Promise<string[]>;
23
+ getImportedModules(): Set<ModuleNode>;
24
+ private collectJs;
25
+ private collectCss;
26
+ }
@@ -0,0 +1,13 @@
1
+ interface CountryLanguages {
2
+ code: string;
3
+ name: string;
4
+ languages: Language[];
5
+ langCultureMs?: Array<{
6
+ langCultureName: string;
7
+ }>;
8
+ }
9
+ interface Language {
10
+ iso639_1: string;
11
+ }
12
+ export declare function getCountryLanguageData(countryCode: string): CountryLanguages | null;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Options } from 'html-minifier-terser';
2
+ export type HtmlMinifyOptions = Options;
3
+ export declare function htmlMinify(html: string, options?: HtmlMinifyOptions): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import type { HTMLBeautifyOptions } from 'js-beautify';
2
+ export type HtmlPrettyOptions = HTMLBeautifyOptions;
3
+ export declare function htmlPretty(html: string, options?: HtmlPrettyOptions): Promise<string>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Utility functions for handling requests that mimic the Firebase Hosting i18n
3
+ * fallback logic.
4
+ * https://firebase.google.com/docs/hosting/i18n-rewrites
5
+ */
6
+ import { Request } from '../core/types.js';
7
+ export declare const UNKNOWN_COUNTRY = "zz";
8
+ export declare const ES_419_COUNTRIES: string[];
9
+ export declare function getFallbackLocales(req: Request): string[];
10
+ export declare function getCountry(req: Request): string;
11
+ export declare function test419Country(countryCode: string): boolean;
@@ -0,0 +1,91 @@
1
+ import { RootConfig } from '../core/config.js';
2
+ import { Request, Response, NextFunction, Route, Sitemap } from '../core/types.js';
3
+ import type { ElementGraph } from '../node/element-graph.js';
4
+ import { AssetMap } from './asset-map/asset-map.js';
5
+ export declare class Renderer {
6
+ private rootConfig;
7
+ private assetMap;
8
+ private elementGraph;
9
+ private router;
10
+ constructor(rootConfig: RootConfig, options: {
11
+ assetMap: AssetMap;
12
+ elementGraph: ElementGraph;
13
+ });
14
+ /** Returns a route from the router. */
15
+ getRoute(url: string): [Route | undefined, Record<string, string>];
16
+ handle(req: Request, res: Response, next: NextFunction): Promise<void>;
17
+ private renderComponent;
18
+ /** SSG renders a route. */
19
+ renderRoute(route: Route, options: {
20
+ routeParams: Record<string, string>;
21
+ }): Promise<{
22
+ html?: string;
23
+ notFound?: boolean;
24
+ }>;
25
+ /** Handles the SSR rendering of a route. */
26
+ handleRoute(req: Request, res: Response, next: NextFunction, route: Route, options?: {
27
+ defaultStatusCode?: number;
28
+ /**
29
+ * URL placeholder params.
30
+ */
31
+ routeParams?: Record<string, string>;
32
+ /**
33
+ * Handler function that tries the next matching route if multiple routes
34
+ * match for a given url path.
35
+ */
36
+ nextRouteHandler?: () => void | Promise<void>;
37
+ }): Promise<void>;
38
+ /**
39
+ * Constructs and returns the project's sitemap.
40
+ *
41
+ * The sitemap is used to:
42
+ * - determine all paths to build in SSG mode
43
+ * - display links on the dev server's 404 page
44
+ * - construct alternates for localized URL paths
45
+ */
46
+ getSitemap(): Promise<Sitemap>;
47
+ private getJsxRenderOptions;
48
+ /**
49
+ * Renders JSX via either the `@blinkk/root/jsx` package or
50
+ * `preact-render-to-string` depending if the `jsxRenderer` config is set up
51
+ * in `root.config.ts`.
52
+ */
53
+ private renderJsx;
54
+ private getConfiguredStyleEntries;
55
+ private renderHtml;
56
+ private ensureNewline;
57
+ render404(options?: {
58
+ currentPath?: string;
59
+ }): Promise<{
60
+ html: string;
61
+ }>;
62
+ renderError(err: any, options?: {
63
+ currentPath?: string;
64
+ }): Promise<{
65
+ html: string;
66
+ }>;
67
+ renderDevServer404(req: Request): Promise<{
68
+ html: string;
69
+ }>;
70
+ renderDevServer500(req: Request, error: unknown): Promise<{
71
+ html: string;
72
+ }>;
73
+ /**
74
+ * Parses rendered HTML for custom element tags used on the page and
75
+ * automatically adds the JS/CSS deps to the page.
76
+ */
77
+ private collectElementDeps;
78
+ /**
79
+ * Returns the `security` config value with default values inserted wherever
80
+ * a user config value is blank or set to `true`.
81
+ */
82
+ private getSecurityConfig;
83
+ /**
84
+ * Generates a random string that can be used as the "nonce" value for CSP.
85
+ */
86
+ private generateNonce;
87
+ /**
88
+ * Sets security-related HTTP headers.
89
+ */
90
+ private setSecurityHeaders;
91
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * A trie data structure that stores routes. Supports Next-style routing using
3
+ * [param], [...catchall], and [[...optcatchall]] placeholders.
4
+ */
5
+ export declare class RouteTrie<T> {
6
+ private children;
7
+ private paramNodes?;
8
+ private catchAllNodes?;
9
+ private optCatchAllNodes?;
10
+ private route?;
11
+ /**
12
+ * Adds a route to the trie.
13
+ */
14
+ add(path: string, route: T): void;
15
+ /**
16
+ * Returns a route mapped to the given path and any parameter values from the
17
+ * URL.
18
+ */
19
+ get(path: string): [T | undefined, Record<string, string>];
20
+ /**
21
+ * Returns all routes that match the given path and their parameter values.
22
+ */
23
+ matchAll(path: string): Array<[T, Record<string, string>]>;
24
+ /**
25
+ * Walks the route trie and calls a callback function for each route.
26
+ */
27
+ walk(cb: (urlPath: string, route: T) => Promise<void> | void): Promise<void>;
28
+ /**
29
+ * Removes all routes from the trie.
30
+ */
31
+ clear(): void;
32
+ private getRoute;
33
+ private collectRoutes;
34
+ /**
35
+ * Normalizes a path for inclusion into the route trie.
36
+ */
37
+ private normalizePath;
38
+ /**
39
+ * Splits the parent directory from its children, e.g.:
40
+ *
41
+ * splitPath("foo/bar/baz") -> ["foo", "bar/baz"]
42
+ */
43
+ private splitPath;
44
+ }
@@ -0,0 +1,18 @@
1
+ import { RootConfig } from '../core/config.js';
2
+ import { Route } from '../core/types.js';
3
+ export declare class Router {
4
+ private rootConfig;
5
+ private routeTrie;
6
+ constructor(rootConfig: RootConfig);
7
+ get(url: string): [Route | undefined, Record<string, string>];
8
+ matchAll(url: string): [Route, Record<string, string>][];
9
+ walk(cb: (urlPath: string, route: Route) => void | Promise<void>): Promise<void>;
10
+ private initRouteTrie;
11
+ getAllPathsForRoute(urlPathFormat: string, route: Route): Promise<Array<{
12
+ urlPath: string;
13
+ params: Record<string, string>;
14
+ }>>;
15
+ }
16
+ export declare function normalizeUrlPath(urlPath: string, options?: {
17
+ trailingSlash?: boolean;
18
+ }): string;
package/dist/render.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  getTranslations,
6
6
  replaceParams,
7
7
  testPathHasParams
8
- } from "./chunk-WAZTR3DX.js";
8
+ } from "./chunk-KW7KTYGC.js";
9
9
  import {
10
10
  RouteTrie,
11
11
  htmlMinify,
@@ -14,12 +14,12 @@ import {
14
14
  } from "./chunk-6P3B7ZXL.js";
15
15
  import {
16
16
  renderJsxToString
17
- } from "./chunk-M6WGW5VY.js";
18
- import "./chunk-FQBA5QSG.js";
17
+ } from "./chunk-DU7JUEDY.js";
18
+ import "./chunk-3Z5TNZEP.js";
19
19
 
20
20
  // src/render/render.tsx
21
- import crypto from "crypto";
22
- import path2 from "path";
21
+ import crypto from "node:crypto";
22
+ import path2 from "node:path";
23
23
  import {
24
24
  options as preactOptions
25
25
  } from "preact";
@@ -12876,7 +12876,7 @@ function test419Country(countryCode) {
12876
12876
  }
12877
12877
 
12878
12878
  // src/render/router.ts
12879
- import path from "path";
12879
+ import path from "node:path";
12880
12880
  import { ROUTE_MODULES, POD_ROUTE_MODULES } from "virtual:root/routes";
12881
12881
  var ROUTES_FILES = ROUTE_MODULES;
12882
12882
  var POD_ROUTES = POD_ROUTE_MODULES || {};
@@ -13125,7 +13125,7 @@ var Renderer = class {
13125
13125
  if (url.includes("%")) {
13126
13126
  try {
13127
13127
  url = decodeURI(url);
13128
- } catch (e) {
13128
+ } catch {
13129
13129
  }
13130
13130
  }
13131
13131
  const matches = this.router.matchAll(url);
@@ -13172,7 +13172,7 @@ var Renderer = class {
13172
13172
  };
13173
13173
  const vdom = /* @__PURE__ */ jsx4(REQUEST_CONTEXT.Provider, { value: ctx, children: /* @__PURE__ */ jsx4(I18N_CONTEXT.Provider, { value: { locale, translations }, children: /* @__PURE__ */ jsx4(HTML_CONTEXT.Provider, { value: htmlContext, children: /* @__PURE__ */ jsx4(Component, { ...props }) }) }) });
13174
13174
  const preactHook = preactOptions.vnode;
13175
- let mainHtml = "";
13175
+ let mainHtml;
13176
13176
  try {
13177
13177
  preactOptions.vnode = (vnode) => {
13178
13178
  if (vnode && vnode.type === "script") {
@@ -13793,4 +13793,4 @@ function guessContentType(ext) {
13793
13793
  export {
13794
13794
  Renderer
13795
13795
  };
13796
- //# sourceMappingURL=render.js.map
13796
+ //# sourceMappingURL=render.js.map