@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.
- package/dist/{chunk-FQBA5QSG.js → chunk-3Z5TNZEP.js} +3 -3
- package/dist/chunk-3Z5TNZEP.js.map +7 -0
- package/dist/{chunk-JCRXBB26.js → chunk-6NBKAR5Y.js} +2 -2
- package/dist/chunk-6NBKAR5Y.js.map +7 -0
- package/dist/chunk-6P3B7ZXL.js +1 -1
- package/dist/chunk-6P3B7ZXL.js.map +7 -1
- package/dist/{chunk-PVBPP5LN.js → chunk-7PSEEE6C.js} +10 -10
- package/dist/chunk-7PSEEE6C.js.map +7 -0
- package/dist/{chunk-M6WGW5VY.js → chunk-DU7JUEDY.js} +48 -6
- package/dist/chunk-DU7JUEDY.js.map +7 -0
- package/dist/{chunk-GSR74KEI.js → chunk-JTZWI4MH.js} +279 -73
- package/dist/chunk-JTZWI4MH.js.map +7 -0
- package/dist/{chunk-WAZTR3DX.js → chunk-KW7KTYGC.js} +2 -2
- package/dist/chunk-KW7KTYGC.js.map +7 -0
- package/dist/chunk-XSNCF7WU.js +1 -1
- package/dist/chunk-XSNCF7WU.js.map +7 -1
- package/dist/cli/build.d.ts +7 -0
- package/dist/cli/cli.d.ts +12 -0
- package/dist/cli/codegen.d.ts +5 -0
- package/dist/cli/create-package.d.ts +14 -0
- package/dist/cli/dev.d.ts +10 -0
- package/dist/cli/gae-deploy.d.ts +18 -0
- package/dist/cli/preview.d.ts +8 -0
- package/dist/cli/start.d.ts +8 -0
- package/dist/cli/startup/check-version.d.ts +17 -0
- package/dist/cli/startup/startup-tasks.d.ts +39 -0
- package/dist/cli.js +4 -4
- package/dist/cli.js.map +7 -1
- package/dist/core/components/Body.d.ts +23 -0
- package/dist/core/components/Head.d.ts +18 -0
- package/dist/core/components/Html.d.ts +24 -0
- package/dist/core/components/Script.d.ts +16 -0
- package/dist/core/config.d.ts +285 -0
- package/dist/core/core.d.ts +14 -0
- package/dist/core/hooks/useI18nContext.d.ts +11 -0
- package/dist/core/hooks/useRequestContext.d.ts +36 -0
- package/dist/core/hooks/useStringParams.d.ts +34 -0
- package/dist/core/hooks/useTranslations.d.ts +20 -0
- package/dist/core/hooks/useTranslationsMiddleware.d.ts +25 -0
- package/dist/core/pages/DevErrorPage.d.ts +9 -0
- package/dist/core/pages/DevNotFoundPage.d.ts +10 -0
- package/dist/core/pages/ErrorPage.d.ts +9 -0
- package/dist/core/plugin.d.ts +80 -0
- package/dist/core/pod.d.ts +54 -0
- package/dist/core/types.d.ts +228 -0
- package/dist/core.js +3 -3
- package/dist/core.js.map +7 -1
- package/dist/functions/functions.d.ts +1 -0
- package/dist/functions/server.d.ts +10 -0
- package/dist/functions.js +5 -5
- package/dist/functions.js.map +7 -1
- package/dist/jsx/jsx-dev-runtime.d.ts +10 -1
- package/dist/jsx/jsx-dev-runtime.js +2 -2
- package/dist/jsx/jsx-dev-runtime.js.map +7 -1
- package/dist/{jsx-C8BaDh-4.d.ts → jsx/jsx-render.d.ts} +3 -6
- package/dist/jsx/jsx-runtime.d.ts +120 -1
- package/dist/jsx/jsx-runtime.js +2 -2
- package/dist/jsx/jsx-runtime.js.map +7 -1
- package/dist/jsx/jsx.d.ts +37 -0
- package/dist/{jsx-dev-runtime-DUJrvx5P.d.ts → jsx/types.d.ts} +9 -125
- package/dist/jsx.js +3 -3
- package/dist/jsx.js.map +7 -1
- package/dist/middleware/common.d.ts +22 -0
- package/dist/middleware/hooks.d.ts +8 -0
- package/dist/middleware/middleware.d.ts +3 -0
- package/dist/middleware/multipart.d.ts +11 -0
- package/dist/middleware/redirects.d.ts +10 -0
- package/dist/middleware/session.d.ts +24 -0
- package/dist/middleware.js +2 -2
- package/dist/middleware.js.map +7 -1
- package/dist/node/element-graph.d.ts +51 -0
- package/dist/node/load-config.d.ts +17 -0
- package/dist/node/monorepo.d.ts +14 -0
- package/dist/node/node.d.ts +4 -0
- package/dist/node/pod-collector.d.ts +33 -0
- package/dist/node/pods-vite-plugin.d.ts +6 -0
- package/dist/node/vite-plugin-preact-alias.d.ts +10 -0
- package/dist/node/vite-plugin-prune-empty-chunks.d.ts +27 -0
- package/dist/node/vite-plugin-root-jsx-virtual.d.ts +16 -0
- package/dist/node/vite.d.ts +18 -0
- package/dist/node.js +2 -2
- package/dist/node.js.map +7 -1
- package/dist/render/accept-language.d.ts +8 -0
- package/dist/render/asset-map/asset-map.d.ts +25 -0
- package/dist/render/asset-map/build-asset-map.d.ts +47 -0
- package/dist/render/asset-map/dev-asset-map.d.ts +26 -0
- package/dist/render/countrie-language.d.ts +13 -0
- package/dist/render/html-minify.d.ts +3 -0
- package/dist/render/html-pretty.d.ts +3 -0
- package/dist/render/i18n-fallbacks.d.ts +11 -0
- package/dist/render/render.d.ts +91 -0
- package/dist/render/route-trie.d.ts +44 -0
- package/dist/render/router.d.ts +18 -0
- package/dist/render.js +9 -9
- package/dist/render.js.map +7 -1
- package/dist/utils/batch.d.ts +1 -0
- package/dist/utils/elements.d.ts +12 -0
- package/dist/utils/fsutils.d.ts +24 -0
- package/dist/utils/i18n.d.ts +8 -0
- package/dist/utils/ports.d.ts +8 -0
- package/dist/utils/rand.d.ts +10 -0
- package/dist/utils/url-path-params.d.ts +2 -0
- package/package.json +14 -15
- package/dist/chunk-FQBA5QSG.js.map +0 -1
- package/dist/chunk-GSR74KEI.js.map +0 -1
- package/dist/chunk-JCRXBB26.js.map +0 -1
- package/dist/chunk-M6WGW5VY.js.map +0 -1
- package/dist/chunk-PVBPP5LN.js.map +0 -1
- package/dist/chunk-WAZTR3DX.js.map +0 -1
- package/dist/cli.d.ts +0 -60
- package/dist/core.d.ts +0 -214
- package/dist/functions.d.ts +0 -14
- package/dist/jsx.d.ts +0 -2
- package/dist/middleware.d.ts +0 -43
- package/dist/node.d.ts +0 -91
- package/dist/render.d.ts +0 -8
- package/dist/types-Cksf99CK.d.ts +0 -827
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/jsx/jsx-render.ts"],"sourcesContent":["import {options as preactOptions} from 'preact';\nimport {VNode, Fragment} from './jsx-runtime.js';\n\n/** HTML void elements (self-closing, no end tag). */\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\n/** Tags whose text content may contain literal newlines that should not be treated as block-child indicators. */\nconst RAW_CONTENT_ELEMENTS = new Set(['pre', 'textarea', 'script', 'style']);\n\n/** Standard HTML block-level elements. */\nconst DEFAULT_BLOCK_ELEMENTS = new Set([\n 'address',\n 'article',\n 'aside',\n 'blockquote',\n 'body',\n 'dd',\n 'details',\n 'dialog',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'li',\n 'link',\n 'main',\n 'meta',\n 'nav',\n 'noscript',\n 'ol',\n 'p',\n 'pre',\n 'script',\n 'search',\n 'section',\n 'style',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'ul',\n]);\n\n/** JSX prop name -> HTML attribute name. */\nconst PROP_TO_ATTR: Record<string, string> = {\n acceptCharset: 'accept-charset',\n autoCapitalize: 'autocapitalize',\n autoComplete: 'autocomplete',\n autoFocus: 'autofocus',\n autoPlay: 'autoplay',\n charSet: 'charset',\n className: 'class',\n colSpan: 'colspan',\n contentEditable: 'contenteditable',\n crossOrigin: 'crossorigin',\n dateTime: 'datetime',\n encType: 'enctype',\n formAction: 'formaction',\n formEncType: 'formenctype',\n formMethod: 'formmethod',\n formNoValidate: 'formnovalidate',\n formTarget: 'formtarget',\n frameBorder: 'frameborder',\n hrefLang: 'hreflang',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n inputMode: 'inputmode',\n itemProp: 'itemprop',\n itemRef: 'itemref',\n itemScope: 'itemscope',\n itemType: 'itemtype',\n maxLength: 'maxlength',\n mediaGroup: 'mediagroup',\n minLength: 'minlength',\n noModule: 'nomodule',\n noValidate: 'novalidate',\n playsInline: 'playsinline',\n readOnly: 'readonly',\n referrerPolicy: 'referrerpolicy',\n rowSpan: 'rowspan',\n spellCheck: 'spellcheck',\n srcDoc: 'srcdoc',\n srcLang: 'srclang',\n srcSet: 'srcset',\n tabIndex: 'tabindex',\n useMap: 'usemap',\n\n // SVG presentation attributes (camelCase -> kebab-case).\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n dominantBaseline: 'dominant-baseline',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n imageRendering: 'image-rendering',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n paintOrder: 'paint-order',\n pointerEvents: 'pointer-events',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strokeDasharray: 'stroke-dasharray',\n strokeDashoffset: 'stroke-dashoffset',\n strokeLinecap: 'stroke-linecap',\n strokeLinejoin: 'stroke-linejoin',\n strokeMiterlimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n vectorEffect: 'vector-effect',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n};\n\nconst AMP = '&';\nconst LT = '<';\nconst GT = '>';\nconst QUOT = '"';\n\n// Shared empty object reused as the per-component context map when no contexts\n// have ever been pushed. Components only ever read from this map, so sharing is\n// safe and avoids a per-render allocation in the common case.\nconst EMPTY_GLOBAL_CTX: Record<string, any> = {};\n\n/** Returns `true` when `value` is neither `null` nor `undefined`. */\nfunction isDef<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\nfunction escapeHtml(str: string): string {\n let result = '';\n let last = 0;\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n let escaped: string | undefined;\n if (ch === 38) escaped = AMP;\n else if (ch === 60) escaped = LT;\n else if (ch === 62) escaped = GT;\n if (escaped) {\n result += str.slice(last, i) + escaped;\n last = i + 1;\n }\n }\n if (last === 0) return str;\n return result + str.slice(last);\n}\n\nfunction escapeAttr(str: string): string {\n let result = '';\n let last = 0;\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n let escaped: string | undefined;\n if (ch === 38) escaped = AMP;\n else if (ch === 34) escaped = QUOT;\n else if (ch === 60) escaped = LT;\n else if (ch === 62) escaped = GT;\n if (escaped) {\n result += str.slice(last, i) + escaped;\n last = i + 1;\n }\n }\n if (last === 0) return str;\n return result + str.slice(last);\n}\n\nconst STYLE_KEY_CACHE = new Map<string, string>();\nconst UPPERCASE_RE = /[A-Z]/g;\n\nfunction toKebabCase(key: string): string {\n let cached = STYLE_KEY_CACHE.get(key);\n if (cached === undefined) {\n cached = key.replace(UPPERCASE_RE, (m) => '-' + m.toLowerCase());\n STYLE_KEY_CACHE.set(key, cached);\n }\n return cached;\n}\n\nfunction styleToString(style: Record<string, any>): string {\n let result = '';\n let first = true;\n for (const key in style) {\n const value = style[key];\n if (!isDef(value) || value === '') continue;\n if (first) {\n first = false;\n } else {\n result += ';';\n }\n result += `${toKebabCase(key)}:${value}`;\n }\n return result;\n}\n\nexport interface JsxRenderOptions {\n /** Render mode. `'pretty'` adds newlines around block elements; `'minimal'` outputs compact HTML. Default: `'pretty'`. */\n mode?: 'pretty' | 'minimal';\n /** Additional tag names to treat as block-level elements in pretty mode. */\n blockElements?: string[];\n}\n\n/**\n * Renders a Preact VNode tree to an HTML string.\n */\nexport function renderJsxToString(\n vnode: VNode,\n options?: JsxRenderOptions\n): string {\n const mode = options?.mode ?? 'pretty';\n const isPretty = mode === 'pretty';\n // In minimal mode `blockSet` is unused (the `isPretty` guard short-circuits\n // any `.has()` call). In pretty mode without custom block elements, reuse the\n // module-level Set instead of allocating a copy.\n let blockSet: ReadonlySet<string> = DEFAULT_BLOCK_ELEMENTS;\n if (isPretty && options?.blockElements && options.blockElements.length > 0) {\n const merged = new Set(DEFAULT_BLOCK_ELEMENTS);\n for (const el of options.blockElements) {\n merged.add(el);\n }\n blockSet = merged;\n }\n\n // Context stacks: context.__c (id) -> value[]\n let contextStacks: Map<string, any[]> | undefined;\n\n // Version counter that bumps whenever a context value is pushed or popped.\n // `buildGlobalContext` uses it to skip rebuilding when nothing changed\n // between sibling component renders (the common case).\n let ctxVersion = 0;\n let cachedGlobalCtx: Record<string, any> = EMPTY_GLOBAL_CTX;\n let cachedGlobalCtxVersion = 0;\n\n function pushCtx(contextId: string, value: any) {\n if (!contextStacks) {\n contextStacks = new Map<string, any[]>();\n }\n let stack = contextStacks.get(contextId);\n if (!stack) {\n stack = [];\n contextStacks.set(contextId, stack);\n }\n stack.push(value);\n ctxVersion++;\n }\n\n function popCtx(contextId: string) {\n const stack = contextStacks?.get(contextId);\n if (stack) {\n stack.pop();\n if (stack.length === 0) {\n contextStacks?.delete(contextId);\n }\n }\n ctxVersion++;\n }\n\n /** Builds the __n (global context) map for hooks. */\n function buildGlobalContext(): Record<string, any> {\n if (ctxVersion === cachedGlobalCtxVersion) return cachedGlobalCtx;\n if (!contextStacks || contextStacks.size === 0) {\n cachedGlobalCtx = EMPTY_GLOBAL_CTX;\n cachedGlobalCtxVersion = ctxVersion;\n return cachedGlobalCtx;\n }\n const globalCtx: Record<string, any> = {};\n for (const [contextId, stack] of contextStacks) {\n if (stack.length > 0) {\n // useContext expects provider.props.value and provider.sub().\n globalCtx[contextId] = {\n props: {value: stack[stack.length - 1]},\n sub: noop,\n };\n }\n }\n cachedGlobalCtx = globalCtx;\n cachedGlobalCtxVersion = ctxVersion;\n return globalCtx;\n }\n\n function render(node: any, inline?: boolean): string {\n if (!isDef(node) || typeof node === 'boolean') return '';\n if (typeof node === 'string') return escapeHtml(node);\n if (typeof node === 'number' || typeof node === 'bigint')\n return String(node);\n if (Array.isArray(node)) {\n let out = '';\n for (let i = 0; i < node.length; i++) {\n out += render(node[i], inline);\n }\n return out;\n }\n\n // Must be a VNode-like object.\n if (typeof node !== 'object' || !('type' in node)) return '';\n\n const {type, props} = node;\n\n // Fragment.\n if (type === Fragment) {\n return renderChildren(props?.children);\n }\n\n // Component (function or class).\n if (typeof type === 'function') {\n return renderComponent(node);\n }\n\n // HTML element.\n if (typeof type === 'string') {\n return renderElement(type, props, inline);\n }\n\n return '';\n }\n\n function renderComponent(vnode: VNode): string {\n const {type, props} = vnode;\n const fn = type as Function;\n\n // Detect context Provider.\n // Root.js local JSX runtime: Provider._isProvider === true, Provider._context\n // is the Context object with a _stack array.\n // Preact >=10.27: Provider === Context (same function). `fn.__c` is the\n // context id string (e.g. \"__cC0\").\n // Preact <10.27: Provider._contextRef (mangled `fn.__`) points to the\n // context object which has `__c` (id) and `__` (default value).\n const fnAny = fn as any;\n if (fnAny._isProvider && fnAny._context) {\n const ctx = fnAny._context;\n ctx._stack.push((props as any).value);\n const result = renderChildren(props.children);\n ctx._stack.pop();\n return result;\n }\n let contextId: string | undefined;\n if (typeof fnAny.__c === 'string' && fnAny.__c.startsWith('__cC')) {\n contextId = fnAny.__c;\n } else if (fnAny.__ && typeof fnAny.__ === 'object' && fnAny.__.__c) {\n contextId = fnAny.__.__c;\n }\n if (contextId) {\n pushCtx(contextId, (props as any).value);\n const result = renderChildren(props.children);\n popCtx(contextId);\n return result;\n }\n\n // Detect context Consumer.\n if ((fn as any).contextType) {\n const ctx = (fn as any).contextType;\n const ctxId: string = ctx.__c;\n const stack = contextStacks?.get(ctxId);\n const value =\n stack && stack.length > 0 ? stack[stack.length - 1] : ctx.__;\n if (typeof props.children === 'function') {\n return render(props.children(value));\n }\n return renderChildren(props.children);\n }\n\n // Regular component — set up a fake component instance so Preact hooks\n // (useContext, useState, useMemo, etc.) work during SSR.\n // Preact's useContext reads from `component.context[context.__c]`.\n const component: any = {\n props,\n context: buildGlobalContext(),\n state: {},\n __v: vnode, // _vnode\n __d: false, // _dirty\n __h: [], // _renderCallbacks\n __s: {}, // _nextState\n __H: null, // _hooks (initialised by hooks addon)\n };\n (vnode as any).__c = component;\n\n // Trigger Preact option hooks so the hooks addon can set currentComponent.\n (preactOptions as any).__b?.(vnode);\n (preactOptions as any).__r?.(vnode);\n\n try {\n // Class component.\n if (fn.prototype && fn.prototype.render) {\n const instance = new (fn as any)(props, component.context);\n instance.__n = component.__n;\n instance.__H = component.__H;\n (vnode as any).__c = instance;\n (preactOptions as any).__r?.(vnode);\n return render(instance.render(instance.props, instance.state));\n }\n\n // Functional component.\n const rendered = fn(props, component.context);\n return render(rendered);\n } finally {\n preactOptions.diffed?.(vnode as any);\n }\n }\n\n function renderElement(\n tag: string,\n props: Record<string, any>,\n inline?: boolean\n ): string {\n const isBlock = isPretty && !inline && blockSet.has(tag);\n const isVoid = VOID_ELEMENTS.has(tag);\n const attrs = renderAttrs(tag, props);\n let result = '<' + tag + attrs + '>';\n\n if (isVoid) {\n if (isBlock) result += '\\n';\n return result;\n }\n\n let inner = '';\n if (isDef(props?.dangerouslySetInnerHTML?.__html)) {\n inner = props.dangerouslySetInnerHTML.__html;\n } else if (isDef(props?.children)) {\n inner = renderChildren(props.children);\n } else if (tag === 'textarea' && props) {\n // For <textarea>, render value/defaultValue as text content since\n // browsers ignore the value attribute on textarea elements.\n const textVal = props.value ?? props.defaultValue;\n if (isDef(textVal)) {\n inner = escapeHtml(String(textVal));\n }\n }\n\n if (isBlock) {\n // When inner content contains block children (indicated by newlines),\n // add a newline after the opening tag so content starts on its own line.\n // Exempt raw-content elements (pre, textarea, script, style) where\n // newlines are literal text, not block-child indicators.\n const hasBlockChildren =\n !RAW_CONTENT_ELEMENTS.has(tag) && inner.includes('\\n');\n if (hasBlockChildren) {\n result += '\\n' + inner + '</' + tag + '>\\n';\n } else {\n result += inner + '</' + tag + '>\\n';\n }\n } else {\n result += inner + '</' + tag + '>';\n }\n\n return result;\n }\n\n function renderAttrs(tag: string, props: Record<string, any>): string {\n if (!props) return '';\n let result = '';\n for (const key in props) {\n if (\n key === 'children' ||\n key === 'dangerouslySetInnerHTML' ||\n key === 'key' ||\n key === 'ref' ||\n key === '__self' ||\n key === '__source'\n ) {\n continue;\n }\n // Skip value/defaultValue on textarea — rendered as text content.\n if (tag === 'textarea' && (key === 'value' || key === 'defaultValue')) {\n continue;\n }\n // Skip event handlers.\n if (key.length > 2 && key[0] === 'o' && key[1] === 'n') continue;\n\n let value = props[key];\n if (!isDef(value)) continue;\n // For standard and boolean attributes, `false` removes the attribute.\n // For data-* attributes, `false` is rendered as the string \"false\".\n if (value === false && !key.startsWith('data-')) continue;\n\n const attrName = PROP_TO_ATTR[key] || key;\n\n // Boolean attributes.\n if (value === true) {\n result += ' ' + attrName;\n continue;\n }\n\n // Style objects.\n if (key === 'style' && typeof value === 'object') {\n value = styleToString(value);\n if (!value) continue;\n }\n\n result += ' ' + attrName + '=\"' + escapeAttr(String(value)) + '\"';\n }\n return result;\n }\n\n /**\n * Returns true if a child node is a text-like value (string, number).\n */\n function isTextNode(child: any): boolean {\n if (!isDef(child) || typeof child === 'boolean') return false;\n return (\n typeof child === 'string' ||\n typeof child === 'number' ||\n typeof child === 'bigint'\n );\n }\n\n /**\n * Checks if an array of children contains a mix of text nodes and elements.\n * When mixed, block elements should render inline to avoid breaking text flow.\n */\n function hasMixedContent(children: any[]): boolean {\n let hasText = false;\n let hasElement = false;\n for (const child of children) {\n if (isTextNode(child)) {\n hasText = true;\n } else if (isDef(child) && typeof child === 'object' && 'type' in child) {\n hasElement = true;\n }\n if (hasText && hasElement) return true;\n }\n return false;\n }\n\n function renderChildren(children: any): string {\n if (!isDef(children)) return '';\n if (Array.isArray(children)) {\n const inline = isPretty && hasMixedContent(children);\n let out = '';\n for (let i = 0; i < children.length; i++) {\n out += render(children[i], inline);\n }\n return out;\n }\n return render(children);\n }\n\n return render(vnode);\n}\n\nfunction noop() {}\n"],"mappings":";;;;;AAAA,SAAQ,WAAW,qBAAoB;AAIvC,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,IAAM,uBAAuB,oBAAI,IAAI,CAAC,OAAO,YAAY,UAAU,OAAO,CAAC;AAG3E,IAAM,yBAAyB,oBAAI,IAAI;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,IAAM,eAAuC;AAAA,EAC3C,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,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B,QAAI,MAAM,QAAQ,QAAQ,GAAG;AAC3B,YAAM,SAAS,YAAY,gBAAgB,QAAQ;AACnD,UAAI,MAAM;AACV,eAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,eAAO,OAAO,SAAS,CAAC,GAAG,MAAM;AAAA,MACnC;AACA,aAAO;AAAA,IACT;AACA,WAAO,OAAO,QAAQ;AAAA,EACxB;AAEA,SAAO,OAAO,KAAK;AACrB;AAEA,SAAS,OAAO;AAAC;","names":["vnode"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/node/monorepo.ts","../src/utils/fsutils.ts","../src/node/load-config.ts","../src/node/pod-collector.ts","../src/node/vite.ts","../src/node/pods-vite-plugin.ts","../src/node/vite-plugin-root-jsx-virtual.ts"],"sourcesContent":["import path from 'node:path';\nimport {getWorkspaces, getWorkspaceRoot, PackageInfo} from 'workspace-tools';\nimport {fileExistsSync, loadJsonSync} from '../utils/fsutils.js';\n\ninterface WorkspacePackage {\n name: string;\n path: string;\n packageJson: PackageInfo;\n}\n\nexport function loadPackageJson(filepath: string): PackageInfo | null {\n if (!fileExistsSync(filepath)) {\n return null;\n }\n return loadJsonSync(filepath);\n}\n\n/**\n * Returns a map of all packages in the monorepo and the corresponding\n * package.json path.\n */\nfunction getMonorepoPackages(\n rootDir: string\n): Record<string, WorkspacePackage> {\n const monorepoRoot = getWorkspaceRoot(rootDir);\n if (!monorepoRoot) {\n return {};\n }\n\n const workspaces = getWorkspaces(monorepoRoot);\n const packages: Record<string, WorkspacePackage> = {};\n workspaces.forEach((workspaceInfo) => {\n packages[workspaceInfo.name] = workspaceInfo;\n });\n return packages;\n}\n\n/**\n * Returns the top-level monorepo package's deps, if any.\n */\nexport function getMonorepoPackageDeps(\n rootDir: string\n): Record<string, string> {\n const monorepoRoot = getWorkspaceRoot(rootDir);\n if (!monorepoRoot) {\n return {};\n }\n\n const packageJsonPath = path.join(monorepoRoot, 'package.json');\n const packageJson = loadPackageJson(packageJsonPath);\n return packageJson?.dependencies || {};\n}\n\n/**\n * Flattens package.json deps from the root project dir, taking into account any\n * deps from the monorepo root as well as any `workspace:` deps from within the\n * monorepo.\n */\nexport function flattenPackageDepsFromMonorepo(\n rootDir: string,\n options?: {ignore?: Set<string>}\n): Record<string, string> {\n const packageJsonPath = path.resolve(rootDir, 'package.json');\n const packageJson = loadPackageJson(packageJsonPath);\n const monorepoDeps = getMonorepoPackageDeps(rootDir);\n\n // Flatten `peerDependencies` and `dependencies`.\n const projectDeps = {\n ...packageJson?.peerDependencies,\n ...packageJson?.dependencies,\n };\n\n const allDeps: Record<string, string> = {};\n const workspacePackages = getMonorepoPackages(rootDir);\n const ignore = options?.ignore || new Set();\n Object.entries(projectDeps).forEach(([depName, depVersion]) => {\n if (\n depName.startsWith('@blinkk/root') &&\n depVersion.startsWith('workspace:')\n ) {\n const packageInfo = workspacePackages[depName];\n if (packageInfo) {\n allDeps[depName] = packageInfo.packageJson.version;\n }\n } else if (depVersion.startsWith('workspace:')) {\n // For internal packages within the workspace, recursively collect the\n // deps from those packages.\n if (ignore.has(depName)) {\n return;\n }\n ignore.add(depName);\n const packageInfo = workspacePackages[depName];\n if (packageInfo) {\n const workspacePackageDir = packageInfo.path;\n const deps = flattenPackageDepsFromMonorepo(workspacePackageDir, {\n ignore: ignore,\n });\n for (const key in deps) {\n const currentValue = allDeps[key];\n if (\n deps[key] &&\n deps[key] !== '*' &&\n (!currentValue || currentValue === '*')\n ) {\n allDeps[key] = deps[key];\n }\n }\n }\n } else if (depVersion === '*' && monorepoDeps[depName]) {\n // For any dependencies using a wildcard version `*`, if the top-level\n // package.json has the depdenency defined, overwrite the version.\n allDeps[depName] = monorepoDeps[depName];\n } else {\n allDeps[depName] = depVersion;\n }\n });\n return sortDeps(allDeps);\n}\n\nfunction sortDeps(deps: Record<string, string>): Record<string, string> {\n const keys = Object.keys(deps).sort();\n const sortedDeps: Record<string, string> = {};\n for (const key of keys) {\n sortedDeps[key] = deps[key];\n }\n return sortedDeps;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport fsExtra from 'fs-extra';\nimport glob from 'tiny-glob';\n\nexport function isJsFile(filename: string) {\n return !!filename.match(/\\.(j|t)sx?$/);\n}\n\nexport async function writeFile(filepath: string, content: string) {\n const dirPath = path.dirname(filepath);\n await makeDir(dirPath);\n await fs.promises.writeFile(filepath, content);\n}\n\nexport async function makeDir(dirpath: string) {\n try {\n await fs.promises.access(dirpath);\n } catch (e) {\n await fs.promises.mkdir(dirpath, {recursive: true});\n }\n}\n\nexport async function copyDir(srcdir: string, dstdir: string) {\n if (!fsExtra.existsSync(srcdir)) {\n return;\n }\n fsExtra.copySync(srcdir, dstdir, {overwrite: true});\n}\n\n/**\n * Copies a glob of files from one directory to another.\n *\n * Example:\n *\n * ```\n * await copyGlob('*.css', 'src/styles', 'dist/html/styles');\n * ```\n */\nexport async function copyGlob(\n pattern: string,\n srcdir: string,\n dstdir: string\n) {\n const files = await glob(pattern, {cwd: srcdir});\n if (files.length > 0) {\n await makeDir(dstdir);\n }\n files.forEach((file) => {\n fsExtra.copySync(path.resolve(srcdir, file), path.resolve(dstdir, file));\n });\n}\n\nexport async function rmDir(dirpath: string) {\n await fs.promises.rm(dirpath, {recursive: true, force: true});\n}\n\nexport async function loadJson<T = unknown>(filepath: string): Promise<T> {\n const content = await fs.promises.readFile(filepath, 'utf-8');\n return JSON.parse(content);\n}\n\nexport function loadJsonSync<T = unknown>(filepath: string): T {\n const content = fs.readFileSync(filepath, 'utf-8');\n return JSON.parse(content);\n}\n\nexport async function writeJson(filepath: string, data: any) {\n const content = JSON.stringify(data, null, 2);\n await writeFile(filepath, content);\n}\n\nexport async function isDirectory(dirpath: string) {\n return fs.promises\n .stat(dirpath)\n .then((fsStat) => {\n return fsStat.isDirectory();\n })\n .catch((err) => {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n });\n}\n\nexport function fileExists(filepath: string): Promise<boolean> {\n return fs.promises\n .access(filepath)\n .then(() => true)\n .catch(() => false);\n}\n\nexport function fileExistsSync(filepath: string): boolean {\n try {\n fs.accessSync(filepath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function dirExists(dirpath: string): Promise<boolean> {\n try {\n const stat = await fs.promises.stat(dirpath);\n return stat.isDirectory();\n } catch (error) {\n if (error.code === 'ENOENT') {\n return false;\n }\n throw error;\n }\n}\n\nexport async function directoryContains(\n dirpath: string,\n subpath: string\n): Promise<boolean> {\n const outer = await fs.promises.realpath(dirpath);\n const inner = await fs.promises.realpath(subpath);\n const rel = path.relative(outer, inner);\n return !rel.startsWith('..');\n}\n\nexport async function listFilesRecursive(dirPath: string): Promise<string[]> {\n const files: string[] = [];\n const entries = await fs.promises.readdir(dirPath, {withFileTypes: true});\n for (const entry of entries) {\n const fullPath = path.join(dirPath, entry.name);\n if (entry.isDirectory()) {\n const subFiles = await listFilesRecursive(fullPath);\n files.push(...subFiles);\n } else {\n files.push(fullPath);\n }\n }\n return files;\n}\n","import path from 'node:path';\nimport {bundleRequire} from 'bundle-require';\nimport {build, Plugin as EsbuildPlugin} from 'esbuild';\nimport {RootConfig} from '../core/config.js';\nimport {fileExists} from '../utils/fsutils.js';\nimport {flattenPackageDepsFromMonorepo} from './monorepo.js';\n\nexport interface ConfigOptions {\n command: string;\n}\n\nexport async function loadRootConfig(\n rootDir: string,\n options: ConfigOptions\n): Promise<RootConfig> {\n const {rootConfig} = await loadRootConfigWithDeps(rootDir, options);\n return rootConfig;\n}\n\nexport async function loadRootConfigWithDeps(\n rootDir: string,\n options: ConfigOptions\n): Promise<{rootConfig: RootConfig; dependencies: string[]}> {\n const configPath = path.resolve(rootDir, 'root.config.ts');\n const exists = await fileExists(configPath);\n if (!exists) {\n throw new Error(`${configPath} does not exist`);\n }\n const configBundle = await bundleRequire({\n filepath: configPath,\n esbuildOptions: {plugins: [esbuildExternalsPlugin({rootDir})]},\n });\n let config = configBundle.mod.default || {};\n if (typeof config === 'function') {\n config = (await config(options)) || {};\n }\n const rootConfig = Object.assign({}, config, {rootDir});\n validateRootconfig(rootConfig);\n return {rootConfig, dependencies: configBundle.dependencies};\n}\n\nfunction validateRootconfig(rootConfig: RootConfig) {\n // Update vite legacy config options.\n const scss: any = rootConfig.vite?.css?.preprocessorOptions?.scss;\n if (scss?.includePaths) {\n console.warn(\n '[deprecation warning] root.config.ts: vite.css.preprocessorOptions.scss.includePaths is deprecated. rename \"includePaths\" -> \"loadPaths\"'\n );\n scss.loadPaths = scss.includePaths;\n }\n}\n\n/**\n * Compiles a root.config.ts file to root.config.js.\n */\nexport async function bundleRootConfig(rootDir: string, outPath: string) {\n const configPath = path.resolve(rootDir, 'root.config.ts');\n const configExists = await fileExists(configPath);\n if (!configExists) {\n throw new Error(`${configPath} does not exist`);\n }\n await build({\n entryPoints: [configPath],\n bundle: true,\n minify: true,\n platform: 'node',\n outfile: outPath,\n sourcemap: 'inline',\n metafile: true,\n format: 'esm',\n plugins: [esbuildExternalsPlugin({rootDir})],\n });\n}\n\n/**\n * Loads a pre-bundled config file from dist/root.config.js.\n */\nexport async function loadBundledConfig(\n rootDir: string,\n options: ConfigOptions\n): Promise<RootConfig> {\n const configPath = path.resolve(rootDir, 'dist/root.config.js');\n const exists = await fileExists(configPath);\n if (!exists) {\n throw new Error(`${configPath} does not exist`);\n }\n const module = await import(configPath);\n let config = module.default || {};\n if (typeof config === 'function') {\n config = (await config(options)) || {};\n }\n return Object.assign({}, config, {rootDir});\n}\n\n/**\n * Externalizes node_modules deps from the package and any dependent packages\n * from the monorepo.\n */\nfunction esbuildExternalsPlugin(options: {rootDir: string}): EsbuildPlugin {\n const rootDir = options.rootDir;\n const allDeps = flattenPackageDepsFromMonorepo(rootDir);\n\n function getPackageName(id: string): string {\n const segments = id.split('/');\n if (segments.length > 1) {\n // Check if package is an org path like `@blinkk/root`.\n if (segments[0].startsWith('@') && segments[0].length > 1) {\n return `${segments[0]}/${segments[1]}`;\n }\n // For imports like `my-package/subpackage`, return `my-package`.\n return segments[0];\n }\n return id;\n }\n\n return {\n name: 'root-externals-plugin',\n setup(build) {\n build.onResolve({filter: /.*/}, (args) => {\n const id = args.path;\n if (id[0] !== '.' && !id.startsWith('@/')) {\n const packageName = getPackageName(id);\n if (packageName in allDeps) {\n return {\n external: true,\n };\n }\n }\n return null;\n });\n },\n };\n}\n","import path from 'node:path';\nimport glob from 'tiny-glob';\nimport {RootConfig} from '../core/config.js';\nimport {Pod, PodConfig} from '../core/pod.js';\nimport {Plugin} from '../core/plugin.js';\nimport {isDirectory, isJsFile} from '../utils/fsutils.js';\n\nexport interface ResolvedPodRoute {\n filePath: string;\n relPath: string;\n routePath: string;\n}\n\nexport interface ResolvedPodCollection {\n filePath: string;\n relPath: string;\n id: string;\n}\n\nexport interface ResolvedPod {\n name: string;\n enabled: boolean;\n mount: string;\n priority: number;\n routesDir?: string;\n elementsDirs: string[];\n bundlesDir?: string;\n collectionsDir?: string;\n translationsDir?: string;\n routeFiles: ResolvedPodRoute[];\n bundleFiles: string[];\n collectionFiles: ResolvedPodCollection[];\n translationFiles: Array<{locale: string; filePath: string}>;\n config: PodConfig;\n}\n\nlet cachedPods: ResolvedPod[] | null = null;\n\nexport function invalidatePodCache() {\n cachedPods = null;\n}\n\nexport async function collectPods(rootConfig: RootConfig): Promise<ResolvedPod[]> {\n if (cachedPods) {\n return cachedPods;\n }\n\n const plugins = rootConfig.plugins || [];\n const userPodConfigs = rootConfig.pods || {};\n\n const rawPods = await resolvePluginPods(plugins, rootConfig);\n const resolved: ResolvedPod[] = [];\n\n const seenNames = new Set<string>();\n for (const pod of rawPods) {\n if (seenNames.has(pod.name)) {\n throw new Error(\n `Duplicate pod name: \"${pod.name}\". Each pod must have a unique name.`\n );\n }\n seenNames.add(pod.name);\n\n const userConfig = userPodConfigs[pod.name] || {};\n if (userConfig.enabled === false) {\n continue;\n }\n\n const resolvedPod = await resolvePod(pod, userConfig, rootConfig);\n resolved.push(resolvedPod);\n }\n\n validateCollectionIds(resolved, rootConfig);\n\n cachedPods = resolved;\n return resolved;\n}\n\nasync function resolvePluginPods(\n plugins: Plugin[],\n rootConfig: RootConfig\n): Promise<Pod[]> {\n const pods: Pod[] = [];\n for (const plugin of plugins) {\n if (!plugin.pod) {\n continue;\n }\n if (typeof plugin.pod === 'function') {\n const result = await plugin.pod({rootConfig});\n pods.push(result);\n } else if (Array.isArray(plugin.pod)) {\n pods.push(...plugin.pod);\n } else {\n pods.push(plugin.pod);\n }\n }\n return pods;\n}\n\nasync function resolvePod(\n pod: Pod,\n userConfig: PodConfig,\n rootConfig: RootConfig\n): Promise<ResolvedPod> {\n const mount = normalizeMountPath(userConfig.mount ?? pod.mount ?? '/');\n const priority = userConfig.priority ?? pod.priority ?? 0;\n\n const routeFiles = pod.routesDir\n ? await scanRouteFiles(pod.routesDir, mount, userConfig, rootConfig)\n : [];\n\n const bundleFiles = pod.bundlesDir\n ? await scanBundleFiles(pod.bundlesDir)\n : [];\n\n const collectionFiles = pod.collectionsDir\n ? await scanCollectionFiles(pod.collectionsDir, userConfig)\n : [];\n\n const translationFiles = pod.translationsDir\n ? await scanTranslationFiles(pod.translationsDir)\n : [];\n\n return {\n name: pod.name,\n enabled: true,\n mount,\n priority,\n routesDir: pod.routesDir,\n elementsDirs: pod.elementsDirs || [],\n bundlesDir: pod.bundlesDir,\n collectionsDir: pod.collectionsDir,\n translationsDir: pod.translationsDir,\n routeFiles,\n bundleFiles,\n collectionFiles,\n translationFiles,\n config: userConfig,\n };\n}\n\nasync function scanRouteFiles(\n routesDir: string,\n mount: string,\n userConfig: PodConfig,\n rootConfig: RootConfig\n): Promise<ResolvedPodRoute[]> {\n if (!(await isDirectory(routesDir))) {\n return [];\n }\n\n const files = await glob('**/*', {cwd: routesDir});\n const routes: ResolvedPodRoute[] = [];\n const excludePatterns = userConfig.routes?.exclude || [];\n\n for (const file of files) {\n const parts = path.parse(file);\n if (parts.name.startsWith('_') || !isJsFile(parts.base)) {\n continue;\n }\n\n if (shouldExclude(file, excludePatterns)) {\n continue;\n }\n\n const filePath = path.join(routesDir, file);\n let relativeRoutePath = '/' + file.replace(/\\\\/g, '/');\n const routeParts = path.parse(relativeRoutePath);\n if (routeParts.name === 'index') {\n relativeRoutePath = routeParts.dir;\n } else {\n relativeRoutePath = path.join(routeParts.dir, routeParts.name);\n }\n relativeRoutePath = relativeRoutePath.replace(/\\\\/g, '/');\n\n const routePath = normalizeRoutePath(mount, relativeRoutePath, rootConfig);\n\n routes.push({filePath, relPath: file, routePath});\n }\n\n return routes;\n}\n\nasync function scanBundleFiles(bundlesDir: string): Promise<string[]> {\n if (!(await isDirectory(bundlesDir))) {\n return [];\n }\n const files = await glob('*', {cwd: bundlesDir});\n return files\n .filter((file) => isJsFile(path.parse(file).base))\n .map((file) => path.join(bundlesDir, file));\n}\n\nasync function scanCollectionFiles(\n collectionsDir: string,\n userConfig: PodConfig\n): Promise<ResolvedPodCollection[]> {\n if (!(await isDirectory(collectionsDir))) {\n return [];\n }\n const files = await glob('**/*.schema.ts', {cwd: collectionsDir});\n const excludeIds = new Set(userConfig.collections?.exclude || []);\n const renameMap = userConfig.collections?.rename || {};\n const collections: ResolvedPodCollection[] = [];\n\n for (const file of files) {\n const parts = path.parse(file);\n const rawId = parts.name.replace('.schema', '');\n if (excludeIds.has(rawId)) {\n continue;\n }\n const id = renameMap[rawId] || rawId;\n collections.push({\n filePath: path.join(collectionsDir, file),\n relPath: file,\n id,\n });\n }\n\n return collections;\n}\n\nasync function scanTranslationFiles(\n translationsDir: string\n): Promise<Array<{locale: string; filePath: string}>> {\n if (!(await isDirectory(translationsDir))) {\n return [];\n }\n const files = await glob('*.json', {cwd: translationsDir});\n return files.map((file) => ({\n locale: path.parse(file).name,\n filePath: path.join(translationsDir, file),\n }));\n}\n\nfunction validateCollectionIds(\n pods: ResolvedPod[],\n rootConfig: RootConfig\n) {\n const seenIds = new Map<string, string>();\n\n for (const pod of pods) {\n for (const col of pod.collectionFiles) {\n const existing = seenIds.get(col.id);\n if (existing) {\n throw new Error(\n `Collection \"${col.id}\" is defined by both \"${existing}\" and ` +\n `\"${pod.name}\". Use rootConfig.pods['${pod.name}'].collections.rename ` +\n `to disambiguate.`\n );\n }\n seenIds.set(col.id, pod.name);\n }\n }\n}\n\nfunction normalizeMountPath(mount: string): string {\n if (!mount.startsWith('/')) {\n mount = '/' + mount;\n }\n if (mount.endsWith('/') && mount.length > 1) {\n mount = mount.slice(0, -1);\n }\n return mount;\n}\n\nfunction normalizeRoutePath(\n mount: string,\n relativeRoutePath: string,\n rootConfig: RootConfig\n): string {\n const basePath = rootConfig.base || '/';\n let fullPath: string;\n if (mount === '/') {\n fullPath = relativeRoutePath || '/';\n } else {\n fullPath = mount + (relativeRoutePath || '');\n }\n\n if (basePath !== '/') {\n const base = basePath.replace(/^\\/|\\/$/g, '');\n fullPath = `/${base}${fullPath}`;\n }\n\n // Collapse multiple slashes.\n fullPath = fullPath.replace(/\\/+/g, '/');\n if (!fullPath.startsWith('/')) {\n fullPath = '/' + fullPath;\n }\n return fullPath || '/';\n}\n\nfunction shouldExclude(\n filePath: string,\n patterns: (string | RegExp)[]\n): boolean {\n for (const pattern of patterns) {\n if (typeof pattern === 'string') {\n if (filePath.includes(pattern)) {\n return true;\n }\n } else {\n if (pattern.test(filePath)) {\n return true;\n }\n }\n }\n return false;\n}\n","import {createServer, ViteDevServer} from 'vite';\nimport type {Plugin, EnvironmentModuleNode} from 'vite';\nimport {RootConfig} from '../core/config.js';\nimport {getVitePlugins} from '../core/plugin.js';\nimport {rootPodsVitePlugin} from './pods-vite-plugin.js';\nimport {preactToRootJsxPlugin} from './vite-plugin-root-jsx-virtual.js';\n\nexport interface CreateViteServerOptions {\n /** Override HMR settings. */\n hmr?: boolean;\n /** The port the server will run on. */\n port?: number;\n /** List of files to include in the optimizeDeps.include config. */\n optimizeDeps?: string[];\n}\n\n/**\n * Returns a vite dev server.\n */\nexport async function createViteServer(\n rootConfig: RootConfig,\n options?: CreateViteServerOptions\n): Promise<ViteDevServer> {\n const rootDir = rootConfig.rootDir;\n const viteConfig = rootConfig.vite || {};\n\n let hmrOptions = viteConfig.server?.hmr;\n if (options?.hmr === false) {\n hmrOptions = false;\n } else if (typeof hmrOptions === 'undefined' && options?.port) {\n // Automatically set the HMR port to `port + 10`. This allows multiple\n // root.js dev servers to run without conflicts.\n hmrOptions = {port: options.port + 10};\n }\n\n const viteServer = await createServer({\n ...viteConfig,\n mode: 'development',\n root: rootDir,\n // publicDir is disabled from the vite dev server since it's handled by the\n // root dev server directly, which allows user middlewares to override\n // files in the public dir.\n publicDir: false,\n server: {\n ...(viteConfig.server || {}),\n middlewareMode: true,\n hmr: hmrOptions,\n },\n appType: 'custom',\n optimizeDeps: {\n ...(viteConfig.optimizeDeps || {}),\n include: [\n ...(options?.optimizeDeps || []),\n ...(viteConfig.optimizeDeps?.include || []),\n ],\n extensions: [...(viteConfig.optimizeDeps?.extensions || []), '.tsx'],\n },\n ssr: {\n ...(viteConfig.ssr || {}),\n noExternal: ['@blinkk/root', '@blinkk/root-cms/richtext', /^virtual:/],\n },\n plugins: [\n rootPodsVitePlugin(rootConfig),\n hmrSSRReload(),\n preactToRootJsxPlugin({useRootJsx: !!rootConfig.jsxRenderer?.mode}),\n ...(viteConfig.plugins || []),\n ...getVitePlugins(rootConfig.plugins || []),\n ],\n });\n return viteServer;\n}\n\n/**\n * Shortcut `viteServer.ssrLoadModule()` without starting an actual dev server.\n */\nexport async function viteSsrLoadModule<T = Record<string, any>>(\n rootConfig: RootConfig,\n file: string\n): Promise<T> {\n const viteServer = await createViteServer(rootConfig, {hmr: false});\n const module = await viteServer.ssrLoadModule(file);\n await viteServer.close();\n return module as T;\n}\n\n/**\n * Vite plugin to reload the page when SSR modules change.\n * https://github.com/vitejs/vite/issues/19114\n */\nfunction hmrSSRReload(): Plugin {\n return {\n name: 'hmr-ssr-reload',\n enforce: 'post',\n hotUpdate: {\n order: 'post',\n handler({modules, server, timestamp}) {\n if (this.environment.name !== 'ssr') {\n return;\n }\n\n let hasSsrOnlyModules = false;\n const invalidatedModules = new Set<EnvironmentModuleNode>();\n for (const mod of modules) {\n if (mod.id === null) {\n continue;\n }\n const clientModule =\n server.environments.client.moduleGraph.getModuleById(mod.id);\n if (clientModule) {\n continue;\n }\n\n hasSsrOnlyModules = true;\n this.environment.moduleGraph.invalidateModule(\n mod,\n invalidatedModules,\n timestamp,\n true\n );\n }\n\n if (hasSsrOnlyModules) {\n server.ws.send({type: 'full-reload'});\n return [];\n }\n\n return;\n },\n },\n };\n}\n","import path from 'node:path';\nimport type {Plugin as VitePlugin} from 'vite';\nimport glob from 'tiny-glob';\nimport {RootConfig} from '../core/config.js';\nimport {isDirectory, isJsFile} from '../utils/fsutils.js';\nimport {collectPods, invalidatePodCache, ResolvedPod} from './pod-collector.js';\n\nexport const VIRTUAL_ROUTES_ID = 'virtual:root/routes';\nexport const VIRTUAL_SCHEMAS_ID = 'virtual:root/schemas';\nexport const VIRTUAL_TRANSLATIONS_ID = 'virtual:root/translations';\n\nconst RESOLVED_VIRTUAL_ROUTES = '\\0' + VIRTUAL_ROUTES_ID;\nconst RESOLVED_VIRTUAL_SCHEMAS = '\\0' + VIRTUAL_SCHEMAS_ID;\nconst RESOLVED_VIRTUAL_TRANSLATIONS = '\\0' + VIRTUAL_TRANSLATIONS_ID;\n\nexport function rootPodsVitePlugin(rootConfig: RootConfig): VitePlugin {\n let podsPromise: Promise<ResolvedPod[]> | null = null;\n\n const getPods = () => {\n if (!podsPromise) {\n podsPromise = collectPods(rootConfig);\n }\n return podsPromise;\n };\n\n return {\n name: 'root:pods',\n enforce: 'pre',\n\n resolveId(id) {\n if (id === VIRTUAL_ROUTES_ID) return RESOLVED_VIRTUAL_ROUTES;\n if (id === VIRTUAL_SCHEMAS_ID) return RESOLVED_VIRTUAL_SCHEMAS;\n if (id === VIRTUAL_TRANSLATIONS_ID) return RESOLVED_VIRTUAL_TRANSLATIONS;\n return null;\n },\n\n async load(id) {\n if (id === RESOLVED_VIRTUAL_ROUTES) {\n return buildRoutesModule(rootConfig, await getPods());\n }\n if (id === RESOLVED_VIRTUAL_SCHEMAS) {\n return buildSchemasModule(rootConfig, await getPods());\n }\n if (id === RESOLVED_VIRTUAL_TRANSLATIONS) {\n return buildTranslationsModule(rootConfig, await getPods());\n }\n return null;\n },\n\n configureServer(server) {\n const watchDirs: string[] = [];\n getPods().then((pods) => {\n for (const pod of pods) {\n if (pod.routesDir) watchDirs.push(pod.routesDir);\n if (pod.collectionsDir) watchDirs.push(pod.collectionsDir);\n if (pod.translationsDir) watchDirs.push(pod.translationsDir);\n if (pod.bundlesDir) watchDirs.push(pod.bundlesDir);\n for (const dir of pod.elementsDirs) {\n watchDirs.push(dir);\n }\n }\n for (const dir of watchDirs) {\n server.watcher.add(dir);\n }\n });\n\n const invalidateVirtualModules = () => {\n invalidatePodCache();\n podsPromise = null;\n const mods = [\n RESOLVED_VIRTUAL_ROUTES,\n RESOLVED_VIRTUAL_SCHEMAS,\n RESOLVED_VIRTUAL_TRANSLATIONS,\n ];\n for (const modId of mods) {\n const mod = server.moduleGraph.getModuleById(modId);\n if (mod) {\n server.moduleGraph.invalidateModule(mod);\n }\n }\n server.ws.send({type: 'full-reload'});\n };\n\n server.watcher.on('add', (filePath) => {\n if (isInPodDir(filePath, watchDirs)) {\n invalidateVirtualModules();\n }\n });\n server.watcher.on('unlink', (filePath) => {\n if (isInPodDir(filePath, watchDirs)) {\n invalidateVirtualModules();\n }\n });\n },\n };\n}\n\nfunction isInPodDir(filePath: string, watchDirs: string[]): boolean {\n for (const dir of watchDirs) {\n if (filePath.startsWith(dir)) {\n return true;\n }\n }\n return false;\n}\n\nasync function buildRoutesModule(\n rootConfig: RootConfig,\n pods: ResolvedPod[]\n): Promise<string> {\n const rootDir = rootConfig.rootDir;\n const imports: string[] = [];\n const userEntries: string[] = [];\n const podEntries: string[] = [];\n let idx = 0;\n\n // User project routes.\n const routesDir = path.join(rootDir, 'routes');\n if (await isDirectory(routesDir)) {\n const files = await glob('**/*', {cwd: routesDir});\n for (const file of files) {\n const parts = path.parse(file);\n if (parts.name.startsWith('_') || !isJsFile(parts.base)) {\n continue;\n }\n const modulePath = `/routes/${file.replace(/\\\\/g, '/')}`;\n const varName = `_r${idx++}`;\n imports.push(`import * as ${varName} from '${modulePath}';`);\n userEntries.push(` '${modulePath}': ${varName},`);\n }\n }\n\n // Pod routes.\n for (const pod of pods) {\n for (const route of pod.routeFiles) {\n const varName = `_r${idx++}`;\n imports.push(`import * as ${varName} from '${route.filePath}';`);\n podEntries.push(\n ` '${route.filePath}': {module: ${varName}, podName: ${JSON.stringify(pod.name)}, routePath: ${JSON.stringify(route.routePath)}, src: ${JSON.stringify(`pod/${pod.name}/${route.relPath}`)}},`\n );\n }\n }\n\n return [\n ...imports,\n '',\n 'export const ROUTE_MODULES = {',\n ...userEntries,\n '};',\n '',\n 'export const POD_ROUTE_MODULES = {',\n ...podEntries,\n '};',\n ].join('\\n');\n}\n\nasync function buildSchemasModule(\n rootConfig: RootConfig,\n pods: ResolvedPod[]\n): Promise<string> {\n const rootDir = rootConfig.rootDir;\n const imports: string[] = [];\n const entries: string[] = [];\n let idx = 0;\n\n // User project collections — these win over pod collections.\n const userCollectionIds = new Set<string>();\n const collectionsDir = path.join(rootDir, 'collections');\n if (await isDirectory(collectionsDir)) {\n const files = await glob('**/*.schema.ts', {cwd: collectionsDir});\n for (const file of files) {\n const parts = path.parse(file);\n const id = parts.name.replace('.schema', '');\n userCollectionIds.add(id);\n const modulePath = `/collections/${file.replace(/\\\\/g, '/')}`;\n const varName = `_s${idx++}`;\n imports.push(`import * as ${varName} from '${modulePath}';`);\n entries.push(` '${modulePath}': ${varName},`);\n }\n }\n\n // Also scan root-level schema files that match the existing patterns\n // (e.g. /templates/**/*.schema.ts), excluding known non-collection dirs.\n const rootSchemaFiles = await scanRootSchemaFiles(rootDir);\n for (const file of rootSchemaFiles) {\n const modulePath = `/${file.replace(/\\\\/g, '/')}`;\n // Skip if already in collections.\n if (modulePath.startsWith('/collections/')) continue;\n const varName = `_s${idx++}`;\n imports.push(`import * as ${varName} from '${modulePath}';`);\n entries.push(` '${modulePath}': ${varName},`);\n }\n\n // Pod collections — user project wins on id collision.\n for (const pod of pods) {\n for (const col of pod.collectionFiles) {\n if (userCollectionIds.has(col.id)) {\n continue;\n }\n const varName = `_s${idx++}`;\n imports.push(`import * as ${varName} from '${col.filePath}';`);\n const key = `/collections/${col.id}.schema.ts`;\n entries.push(` '${key}': ${varName},`);\n }\n }\n\n return [\n ...imports,\n '',\n 'export const SCHEMA_MODULES = {',\n ...entries,\n '};',\n ].join('\\n');\n}\n\nasync function scanRootSchemaFiles(rootDir: string): Promise<string[]> {\n const excludeDirs = ['appengine', 'functions', 'gae', 'node_modules', 'dist'];\n let files: string[];\n try {\n files = await glob('**/*.schema.ts', {cwd: rootDir});\n } catch {\n return [];\n }\n return files.filter((file) => {\n const normalized = file.replace(/\\\\/g, '/');\n return !excludeDirs.some((dir) => normalized.startsWith(dir + '/'));\n });\n}\n\nasync function buildTranslationsModule(\n rootConfig: RootConfig,\n pods: ResolvedPod[]\n): Promise<string> {\n const rootDir = rootConfig.rootDir;\n const imports: string[] = [];\n const entries: string[] = [];\n let idx = 0;\n\n // User translations take precedence.\n const userLocales = new Set<string>();\n const translationsDir = path.join(rootDir, 'translations');\n if (await isDirectory(translationsDir)) {\n const files = await glob('*.json', {cwd: translationsDir});\n for (const file of files) {\n const locale = path.parse(file).name;\n userLocales.add(locale);\n const modulePath = `/translations/${file}`;\n const varName = `_t${idx++}`;\n imports.push(`import ${varName} from '${modulePath}';`);\n entries.push(` '${modulePath}': {default: ${varName}},`);\n }\n }\n\n // Pod translations.\n for (const pod of pods) {\n for (const t of pod.translationFiles) {\n const varName = `_t${idx++}`;\n imports.push(`import ${varName} from '${t.filePath}';`);\n // Use a synthetic key that includes the pod name for merging.\n const key = `/translations/pod:${pod.name}:${t.locale}.json`;\n entries.push(` '${key}': {default: ${varName}},`);\n }\n }\n\n return [\n ...imports,\n '',\n 'export const TRANSLATION_MODULES = {',\n ...entries,\n '};',\n ].join('\\n');\n}\n","import type {Plugin} from 'vite';\n\nexport interface PreactToRootJsxPluginOptions {\n /** Whether Root's JSX renderer mode is enabled. */\n useRootJsx?: boolean;\n}\n\n/**\n * Vite plugin that aliases `preact` imports to `@blinkk/root/jsx` in the SSR\n * environment only.\n *\n * When `jsxRenderer.mode` is configured, the project uses Root's built-in JSX\n * runtime instead of Preact for server-side rendering. This plugin redirects\n * `preact` imports (`preact`, `preact/hooks`, `preact/jsx-runtime`, etc.) to\n * Root's JSX package, but only in the SSR environment. Client-side code (e.g.\n * islands that depend on real Preact for hydration) is left untouched.\n */\nexport function preactToRootJsxPlugin(\n options?: PreactToRootJsxPluginOptions\n): Plugin {\n const useRootJsx = options?.useRootJsx ?? false;\n\n /**\n * Preact import specifiers to redirect in SSR when `jsxRenderer.mode` is\n * enabled.\n */\n const SSR_REDIRECTS: Record<string, string> = {\n preact: '@blinkk/root/jsx',\n 'preact/hooks': '@blinkk/root/jsx',\n 'preact/jsx-runtime': '@blinkk/root/jsx/jsx-runtime',\n 'preact/jsx-dev-runtime': '@blinkk/root/jsx/jsx-dev-runtime',\n };\n\n return {\n name: 'root:preact-to-jsx',\n async resolveId(id, importer, resolveOptions) {\n if (!useRootJsx) {\n return null;\n }\n\n const ssrTarget = SSR_REDIRECTS[id];\n if (!ssrTarget) {\n return null;\n }\n\n // Only rewrite in the SSR environment. Client-side code (islands)\n // continues to use the real Preact package.\n const isSSR = this.environment?.name === 'ssr';\n if (!isSSR) {\n return null;\n }\n\n const resolved = await this.resolve(ssrTarget, importer, {\n ...resolveOptions,\n skipSelf: true,\n });\n return resolved;\n },\n };\n}\n"],"mappings":";;;;;AAAA,OAAOA,WAAU;AACjB,SAAQ,eAAe,wBAAoC;;;ACD3D,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,OAAO,aAAa;AACpB,OAAO,UAAU;AAEV,SAAS,SAAS,UAAkB;AACzC,SAAO,CAAC,CAAC,SAAS,MAAM,aAA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AA,MAC3B,GAAG,eAAe,WAAW,WAAW,CAAC,CAAC;AAAA,IAC5C;AAAA,EACF,CAAC;AACD,SAAO;AACT;AAKA,eAAsB,kBACpB,YACA,MACY;AACZ,QAAM,aAAa,MAAM,iBAAiB,YAAY,EAAC,KAAK,MAAK,CAAC;AAClE,QAAM,SAAS,MAAM,WAAW,cAAc,IAAI;AAClD,QAAM,WAAW,MAAM;AACvB,SAAO;AACT;AAMA,SAAS,eAAuB;AAC9B,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,MACT,OAAO;AAAA,MACP,QAAQ,EAAC,SAAS,QAAQ,UAAS,GAAG;AACpC,YAAI,KAAK,YAAY,SAAS,OAAO;AACnC;AAAA,QACF;AAEA,YAAI,oBAAoB;AACxB,cAAM,qBAAqB,oBAAI,IAA2B;AAC1D,mBAAW,OAAO,SAAS;AACzB,cAAI,IAAI,OAAO,MAAM;AACnB;AAAA,UACF;AACA,gBAAM,eACJ,OAAO,aAAa,OAAO,YAAY,cAAc,IAAI,EAAE;AAC7D,cAAI,cAAc;AAChB;AAAA,UACF;AAEA,8BAAoB;AACpB,eAAK,YAAY,YAAY;AAAA,YAC3B;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAEA,YAAI,mBAAmB;AACrB,iBAAO,GAAG,KAAK,EAAC,MAAM,cAAa,CAAC;AACpC,iBAAO,CAAC;AAAA,QACV;AAEA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["path","path","path","path","build","path","glob","glob","path","path","glob","path","glob"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/components/Html.tsx","../src/core/hooks/useI18nContext.ts","../src/core/hooks/useRequestContext.ts","../src/utils/url-path-params.ts"],"sourcesContent":["import {ComponentChildren, FunctionalComponent, createContext} from 'preact';\nimport {useContext} from 'preact/hooks';\n\nexport interface HtmlContext {\n htmlAttrs: preact.JSX.HTMLAttributes<HTMLHtmlElement>;\n headAttrs: preact.JSX.HTMLAttributes<HTMLHeadElement>;\n headComponents: ComponentChildren[];\n bodyAttrs: preact.JSX.HTMLAttributes<HTMLBodyElement>;\n scriptDeps: Array<preact.JSX.ScriptHTMLAttributes<HTMLScriptElement>>;\n}\n\nexport const HTML_CONTEXT = createContext<HtmlContext | null>(null);\n\nexport type HtmlProps = preact.JSX.HTMLAttributes<HTMLHtmlElement> & {\n children?: ComponentChildren;\n};\n\n/**\n * The `<Html>` component can be used to update attrs in the `<html>` tag.\n *\n * Usage:\n *\n * ```tsx\n * <Html lang=\"en-US\">\n * <h1>Hello world</h1>\n * </Html>\n * ```\n */\nexport const Html: FunctionalComponent<HtmlProps> = ({children, ...attrs}) => {\n const context = useContext(HTML_CONTEXT);\n if (!context) {\n throw new Error(\n 'HTML_CONTEXT not found, double-check usage of the <Html> component'\n );\n }\n context.htmlAttrs = attrs;\n return <>{children}</>;\n};\n","import path from 'node:path';\nimport {createContext} from 'preact';\nimport {useContext} from 'preact/hooks';\n\nexport const I18N_CONTEXT = createContext<I18nContext | null>(null);\n\nexport interface I18nContext {\n locale: string;\n translations: Record<string, string>;\n}\n\n/**\n * A hook that returns information about the current i18n context, including the\n * locale for the given route and a map of translations for that locale.\n */\nexport function useI18nContext() {\n const context = useContext(I18N_CONTEXT);\n if (!context) {\n throw new Error('I18N_CONTEXT not found');\n }\n return context;\n}\n\nexport function getTranslations(locale: string): Record<string, string> {\n const translations: Record<string, Record<string, string>> = {};\n const translationsFiles = import.meta.glob(['/translations/*.json'], {\n eager: true,\n }) as Record<string, {default?: Record<string, string>}>;\n Object.keys(translationsFiles).forEach((translationPath) => {\n const parts = path.parse(translationPath);\n const locale = parts.name;\n const module = translationsFiles[translationPath];\n if (module && module.default) {\n translations[locale] = module.default;\n }\n });\n return translations[locale] || {};\n}\n","import {createContext} from 'preact';\nimport {useContext} from 'preact/hooks';\nimport {Route} from '../types.js';\n\nexport interface RequestContext {\n /**\n * The current request path, e.g. `/foo/bar` (default route path) or\n * `/{locale}/foo/bar` (localized route path).\n */\n currentPath: string;\n /** The route file. */\n route: Route;\n /**\n * Route param values. E.g. for a route like `routes/blog/[slug].tsx`,\n * visiting `/blog/foo` will pass {slug: 'foo'} here.\n */\n routeParams: Record<string, string>;\n /** Props passed to the route's server component. */\n props: any;\n /** The current locale. */\n locale: string;\n /** Translations map for the current locale. */\n translations: Record<string, string>;\n /** CSP nonce value. */\n nonce?: string;\n}\n\nexport const REQUEST_CONTEXT = createContext<RequestContext | null>(null);\n\n/**\n * A hook that returns information about the current route.\n *\n * Usage:\n *\n * ```ts\n * const ctx = useRequestContext();\n * ctx.route.src;\n * // => 'routes/index.tsx'\n * ```\n */\nexport function useRequestContext() {\n const context = useContext(REQUEST_CONTEXT);\n if (!context) {\n throw new Error('REQUEST_CONTEXT not found');\n }\n return context;\n}\n","export function replaceParams(\n urlPathFormat: string,\n params: Record<string, string>\n) {\n const urlPath = urlPathFormat.replaceAll(\n /\\[\\[?(\\.\\.\\.)?([\\w\\-_]*)\\]?\\]/g,\n (match: string, _wildcard: string, key: string) => {\n const val = params[key];\n if (!val) {\n throw new Error(`unreplaced param ${match} in url: ${urlPathFormat}`);\n }\n return val;\n }\n );\n return urlPath;\n}\n\nexport function testPathHasParams(urlPath: string) {\n const segments = urlPath.split('/');\n return segments.some((segment) => {\n return segment.startsWith('[') && segment.includes(']');\n });\n}\n"],"mappings":";AAAA,SAAgD,qBAAoB;AACpE,SAAQ,kBAAiB;AAmChB;AAzBF,IAAM,eAAe,cAAkC,IAAI;AAiB3D,IAAM,OAAuC,CAAC,EAAC,UAAU,GAAG,MAAK,MAAM;AAC5E,QAAM,UAAU,WAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,UAAQ,YAAY;AACpB,SAAO,gCAAG,UAAS;AACrB;;;ACrCA,OAAO,UAAU;AACjB,SAAQ,iBAAAA,sBAAoB;A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,YAAY;AAChC,WAAO,QAAQ,WAAW,GAAG,KAAK,QAAQ,SAAS,GAAG;AAAA,EACxD,CAAC;AACH;","names":["createContext","useContext","locale","createContext","useContext"]}
|
package/dist/cli.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { f as Server } from './types-Cksf99CK.js';
|
|
2
|
-
import 'express';
|
|
3
|
-
import 'preact';
|
|
4
|
-
import 'vite';
|
|
5
|
-
import './jsx-C8BaDh-4.js';
|
|
6
|
-
import './jsx-dev-runtime-DUJrvx5P.js';
|
|
7
|
-
import 'html-minifier-terser';
|
|
8
|
-
import 'js-beautify';
|
|
9
|
-
|
|
10
|
-
interface BuildOptions {
|
|
11
|
-
ssrOnly?: boolean;
|
|
12
|
-
mode?: string;
|
|
13
|
-
concurrency?: string | number;
|
|
14
|
-
filter?: string;
|
|
15
|
-
}
|
|
16
|
-
declare function build(rootProjectDir?: string, options?: BuildOptions): Promise<void>;
|
|
17
|
-
|
|
18
|
-
type DeployTarget = 'appengine' | 'firebase';
|
|
19
|
-
interface CreatePackageOptions {
|
|
20
|
-
mode?: string;
|
|
21
|
-
out?: string;
|
|
22
|
-
target?: DeployTarget;
|
|
23
|
-
version?: string;
|
|
24
|
-
appYaml?: string;
|
|
25
|
-
}
|
|
26
|
-
declare function createPackage(rootProjectDir?: string, options?: CreatePackageOptions): Promise<void>;
|
|
27
|
-
|
|
28
|
-
interface DevOptions {
|
|
29
|
-
host?: string;
|
|
30
|
-
}
|
|
31
|
-
declare function dev(rootProjectDir?: string, options?: DevOptions): Promise<void>;
|
|
32
|
-
declare function createDevServer(options?: {
|
|
33
|
-
rootDir?: string;
|
|
34
|
-
port?: number;
|
|
35
|
-
}): Promise<Server>;
|
|
36
|
-
|
|
37
|
-
interface PreviewOptions {
|
|
38
|
-
host?: string;
|
|
39
|
-
}
|
|
40
|
-
declare function preview(rootProjectDir?: string, options?: PreviewOptions): Promise<void>;
|
|
41
|
-
declare function createPreviewServer(options: {
|
|
42
|
-
rootDir: string;
|
|
43
|
-
}): Promise<Server>;
|
|
44
|
-
|
|
45
|
-
interface StartOptions {
|
|
46
|
-
host?: string;
|
|
47
|
-
}
|
|
48
|
-
declare function start(rootProjectDir?: string, options?: StartOptions): Promise<void>;
|
|
49
|
-
declare function createProdServer(options: {
|
|
50
|
-
rootDir: string;
|
|
51
|
-
}): Promise<Server>;
|
|
52
|
-
|
|
53
|
-
declare class CliRunner {
|
|
54
|
-
private name;
|
|
55
|
-
private version;
|
|
56
|
-
constructor(name: string, version: string);
|
|
57
|
-
run(argv: string[]): Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { type BuildOptions, CliRunner, build, createDevServer, createPackage, createPreviewServer, createProdServer, dev, preview, start };
|
package/dist/core.d.ts
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { g as Route } from './types-Cksf99CK.js';
|
|
2
|
-
export { u as ConfigureServerHook, v as ConfigureServerOptions, C as ContentSecurityPolicyConfig, I as GetStaticContent, B as GetStaticPaths, G as GetStaticProps, E as Handler, H as HandlerContext, O as HandlerRenderFn, K as HandlerRenderOptions, L as LocaleGroup, M as MultipartFile, N as NextFunction, x as Plugin, w as PluginHooks, p as Pod, P as PodConfig, q as PodFactory, t as PostBuildOptions, a as Request, D as RequestMiddleware, b as Response, j as RootBuildConfig, R as RootConfig, l as RootHeaderConfig, i as RootI18nConfig, k as RootRedirectConfig, m as RootSecurityConfig, n as RootServerConfig, h as RootUserConfig, J as RouteModule, A as RouteParams, f as Server, Q as Sitemap, T as SitemapItem, F as StaticContentResult, X as XFrameOptionsConfig, y as configureServerPlugins, o as defineConfig, r as definePod, z as getVitePlugins } from './types-Cksf99CK.js';
|
|
3
|
-
import * as preact$1 from 'preact';
|
|
4
|
-
import { FunctionalComponent, ComponentChildren } from 'preact';
|
|
5
|
-
import 'express';
|
|
6
|
-
import 'vite';
|
|
7
|
-
import './jsx-C8BaDh-4.js';
|
|
8
|
-
import './jsx-dev-runtime-DUJrvx5P.js';
|
|
9
|
-
import 'html-minifier-terser';
|
|
10
|
-
import 'js-beautify';
|
|
11
|
-
|
|
12
|
-
type BodyProps = preact.JSX.HTMLAttributes<HTMLBodyElement> & {
|
|
13
|
-
children?: ComponentChildren;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* The `<Body>` component can be used to update attrs in the `<body>` tag.
|
|
17
|
-
*
|
|
18
|
-
* Usage:
|
|
19
|
-
*
|
|
20
|
-
* ```tsx
|
|
21
|
-
* <Body className="body">
|
|
22
|
-
* <h1>Hello world</h1>
|
|
23
|
-
* </Body>
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* Output:
|
|
27
|
-
*
|
|
28
|
-
* ```html
|
|
29
|
-
* <body class="body">
|
|
30
|
-
* <h1>Hello world</h1>
|
|
31
|
-
* </body>
|
|
32
|
-
*/
|
|
33
|
-
declare const Body: FunctionalComponent<BodyProps>;
|
|
34
|
-
|
|
35
|
-
type HeadProps = preact.JSX.HTMLAttributes<HTMLHeadElement> & {
|
|
36
|
-
children?: ComponentChildren;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* The <Head> component can be used for injecting elements into the HTML head
|
|
40
|
-
* tag from any part of a page. The <Head> can be added via any component or
|
|
41
|
-
* sub-component and will automatically be hoisted to the `<head>` element.
|
|
42
|
-
*
|
|
43
|
-
* Usage:
|
|
44
|
-
*
|
|
45
|
-
* ```tsx
|
|
46
|
-
* <Head>
|
|
47
|
-
* <link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
48
|
-
* </Head>
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
declare const Head: FunctionalComponent<HeadProps>;
|
|
52
|
-
|
|
53
|
-
interface HtmlContext {
|
|
54
|
-
htmlAttrs: preact$1.JSX.HTMLAttributes<HTMLHtmlElement>;
|
|
55
|
-
headAttrs: preact$1.JSX.HTMLAttributes<HTMLHeadElement>;
|
|
56
|
-
headComponents: ComponentChildren[];
|
|
57
|
-
bodyAttrs: preact$1.JSX.HTMLAttributes<HTMLBodyElement>;
|
|
58
|
-
scriptDeps: Array<preact$1.JSX.ScriptHTMLAttributes<HTMLScriptElement>>;
|
|
59
|
-
}
|
|
60
|
-
declare const HTML_CONTEXT: preact$1.Context<HtmlContext | null>;
|
|
61
|
-
type HtmlProps = preact$1.JSX.HTMLAttributes<HTMLHtmlElement> & {
|
|
62
|
-
children?: ComponentChildren;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* The `<Html>` component can be used to update attrs in the `<html>` tag.
|
|
66
|
-
*
|
|
67
|
-
* Usage:
|
|
68
|
-
*
|
|
69
|
-
* ```tsx
|
|
70
|
-
* <Html lang="en-US">
|
|
71
|
-
* <h1>Hello world</h1>
|
|
72
|
-
* </Html>
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
declare const Html: FunctionalComponent<HtmlProps>;
|
|
76
|
-
|
|
77
|
-
type ScriptProps = preact.JSX.HTMLAttributes<HTMLScriptElement> & {
|
|
78
|
-
src?: string;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* The <Script> component is used for rendering any custom script modules. At
|
|
82
|
-
* the moment, the system only pre-renders and bundles files that are in the
|
|
83
|
-
* `/bundles` folder at the root of the project.
|
|
84
|
-
*
|
|
85
|
-
* Usage:
|
|
86
|
-
*
|
|
87
|
-
* ```tsx
|
|
88
|
-
* <Script src="/bundles/main.ts" />
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
declare const Script: FunctionalComponent<ScriptProps>;
|
|
92
|
-
|
|
93
|
-
type StringParamsContext = Record<string, string>;
|
|
94
|
-
interface StringParamsProviderProps {
|
|
95
|
-
value?: StringParamsContext;
|
|
96
|
-
children?: ComponentChildren;
|
|
97
|
-
}
|
|
98
|
-
declare const StringParamsProvider: FunctionalComponent<StringParamsProviderProps>;
|
|
99
|
-
/**
|
|
100
|
-
* A hook that returns a map of string params, configured via the
|
|
101
|
-
* `StringParamsProvider` context provider. These params are automatically
|
|
102
|
-
* applied to the `useTranslations()` hook.
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* Usage:
|
|
106
|
-
*
|
|
107
|
-
* ```
|
|
108
|
-
* export default function Page() {
|
|
109
|
-
* return (
|
|
110
|
-
* <StringParamsProvider value={{name: 'Alice'}}>
|
|
111
|
-
* <SayHello />
|
|
112
|
-
* </StringParamsProvider>
|
|
113
|
-
* );
|
|
114
|
-
* }
|
|
115
|
-
*
|
|
116
|
-
* function SayHello() {
|
|
117
|
-
* const t = useTranslations();
|
|
118
|
-
* return <h1>{t('Hello, {name}!')}</h1>;
|
|
119
|
-
* }
|
|
120
|
-
* ```
|
|
121
|
-
*
|
|
122
|
-
* This should render `<h1>Hello, Alice!</h1>`.
|
|
123
|
-
*/
|
|
124
|
-
declare function useStringParams(): StringParamsContext;
|
|
125
|
-
|
|
126
|
-
type TransformFn = (str: string) => string;
|
|
127
|
-
interface TranslationMiddleware {
|
|
128
|
-
/** Transform the string before translation lookup. */
|
|
129
|
-
beforeTranslate?: TransformFn;
|
|
130
|
-
/** Transform the string after translation lookup. */
|
|
131
|
-
afterTranslate?: TransformFn;
|
|
132
|
-
/** Transform the string before `{param}` values are replaced. */
|
|
133
|
-
beforeReplaceParams?: TransformFn;
|
|
134
|
-
/** Transform the string after `{param}` values are replaced. */
|
|
135
|
-
afterReplaceParams?: TransformFn;
|
|
136
|
-
}
|
|
137
|
-
interface TranslationMiddlewareContext {
|
|
138
|
-
beforeTranslateFns: TransformFn[];
|
|
139
|
-
afterTranslateFns: TransformFn[];
|
|
140
|
-
beforeReplaceParamsFns: TransformFn[];
|
|
141
|
-
afterReplaceParamsFns: TransformFn[];
|
|
142
|
-
}
|
|
143
|
-
interface TranslationMiddlewareProviderProps {
|
|
144
|
-
value?: TranslationMiddleware;
|
|
145
|
-
children?: ComponentChildren;
|
|
146
|
-
}
|
|
147
|
-
declare const TranslationMiddlewareProvider: FunctionalComponent<TranslationMiddlewareProviderProps>;
|
|
148
|
-
declare function useTranslationMiddleware(): TranslationMiddlewareContext;
|
|
149
|
-
|
|
150
|
-
interface I18nContext {
|
|
151
|
-
locale: string;
|
|
152
|
-
translations: Record<string, string>;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* A hook that returns information about the current i18n context, including the
|
|
156
|
-
* locale for the given route and a map of translations for that locale.
|
|
157
|
-
*/
|
|
158
|
-
declare function useI18nContext(): I18nContext;
|
|
159
|
-
declare function getTranslations(locale: string): Record<string, string>;
|
|
160
|
-
|
|
161
|
-
interface RequestContext {
|
|
162
|
-
/**
|
|
163
|
-
* The current request path, e.g. `/foo/bar` (default route path) or
|
|
164
|
-
* `/{locale}/foo/bar` (localized route path).
|
|
165
|
-
*/
|
|
166
|
-
currentPath: string;
|
|
167
|
-
/** The route file. */
|
|
168
|
-
route: Route;
|
|
169
|
-
/**
|
|
170
|
-
* Route param values. E.g. for a route like `routes/blog/[slug].tsx`,
|
|
171
|
-
* visiting `/blog/foo` will pass {slug: 'foo'} here.
|
|
172
|
-
*/
|
|
173
|
-
routeParams: Record<string, string>;
|
|
174
|
-
/** Props passed to the route's server component. */
|
|
175
|
-
props: any;
|
|
176
|
-
/** The current locale. */
|
|
177
|
-
locale: string;
|
|
178
|
-
/** Translations map for the current locale. */
|
|
179
|
-
translations: Record<string, string>;
|
|
180
|
-
/** CSP nonce value. */
|
|
181
|
-
nonce?: string;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* A hook that returns information about the current route.
|
|
185
|
-
*
|
|
186
|
-
* Usage:
|
|
187
|
-
*
|
|
188
|
-
* ```ts
|
|
189
|
-
* const ctx = useRequestContext();
|
|
190
|
-
* ctx.route.src;
|
|
191
|
-
* // => 'routes/index.tsx'
|
|
192
|
-
* ```
|
|
193
|
-
*/
|
|
194
|
-
declare function useRequestContext(): RequestContext;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* A hook that returns a function that can be used to translate a string, and
|
|
198
|
-
* optionally replace any parameterized values that are surrounded in curly
|
|
199
|
-
* braces.
|
|
200
|
-
*
|
|
201
|
-
* Usage:
|
|
202
|
-
*
|
|
203
|
-
* ```ts
|
|
204
|
-
* const t = useTranslations();
|
|
205
|
-
* t('Hello {name}', {name: 'Bob'});
|
|
206
|
-
* // => 'Bounjour Bob'
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
209
|
-
declare function useTranslations(): (str: string, params?: Record<string, string | number>) => string;
|
|
210
|
-
|
|
211
|
-
declare function replaceParams(urlPathFormat: string, params: Record<string, string>): string;
|
|
212
|
-
declare function testPathHasParams(urlPath: string): boolean;
|
|
213
|
-
|
|
214
|
-
export { Body, HTML_CONTEXT, Head, Html, type I18nContext, type RequestContext, Route, Script, type StringParamsContext, StringParamsProvider, TranslationMiddlewareProvider, getTranslations, replaceParams, testPathHasParams, useI18nContext, useRequestContext, useStringParams, useTranslationMiddleware, useTranslations };
|
package/dist/functions.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as firebase_functions_v2_https from 'firebase-functions/v2/https';
|
|
2
|
-
import { HttpsOptions } from 'firebase-functions/v2/https';
|
|
3
|
-
|
|
4
|
-
interface ProdServerOptions {
|
|
5
|
-
rootDir?: string;
|
|
6
|
-
mode?: 'preview' | 'production';
|
|
7
|
-
httpsOptions?: HttpsOptions;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Firebase Function that runs a Root.js server running in SSR mode.
|
|
11
|
-
*/
|
|
12
|
-
declare function server(options?: ProdServerOptions): firebase_functions_v2_https.HttpsFunction;
|
|
13
|
-
|
|
14
|
-
export { type ProdServerOptions, server };
|
package/dist/jsx.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { A as AriaAttributes, b as ComponentChild, C as ComponentChildren, d as ComponentType, f as Context, D as DOMAttributes, F as Fragment, e as FunctionalComponent, H as HTMLAttributes, J as JSX, K as Key, S as SVGAttributes, g as ScriptHTMLAttributes, V as VNode, a as createContext, c as createElement, c as h, j as jsx, j as jsxs, o as options, u as useContext } from './jsx-dev-runtime-DUJrvx5P.js';
|
|
2
|
-
export { r as renderJsxToString } from './jsx-C8BaDh-4.js';
|
package/dist/middleware.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { R as RootConfig, a as Request, b as Response, N as NextFunction } from './types-Cksf99CK.js';
|
|
2
|
-
export { S as SESSION_COOKIE, d as SaveSessionOptions, e as Session, c as SessionMiddlewareOptions, s as sessionMiddleware } from './types-Cksf99CK.js';
|
|
3
|
-
import { RequestHandler } from 'express';
|
|
4
|
-
import 'preact';
|
|
5
|
-
import 'vite';
|
|
6
|
-
import './jsx-C8BaDh-4.js';
|
|
7
|
-
import './jsx-dev-runtime-DUJrvx5P.js';
|
|
8
|
-
import 'html-minifier-terser';
|
|
9
|
-
import 'js-beautify';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Middleware that injects the root.js project config into the request context.
|
|
13
|
-
*/
|
|
14
|
-
declare function rootProjectMiddleware(options: {
|
|
15
|
-
rootConfig: RootConfig;
|
|
16
|
-
}): (req: Request, _: Response, next: NextFunction) => void;
|
|
17
|
-
/**
|
|
18
|
-
* Middleware that injects HTTP headers from the `server.headers` config in
|
|
19
|
-
* root.config.ts.
|
|
20
|
-
*/
|
|
21
|
-
declare function headersMiddleware(options: {
|
|
22
|
-
rootConfig: RootConfig;
|
|
23
|
-
}): (req: Request, res: Response, next: NextFunction) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Trailing slash middleware. Handles trailing slash redirects (preserving any
|
|
26
|
-
* query params) using the `server.trailingSlash` config in root.config.ts.
|
|
27
|
-
*/
|
|
28
|
-
declare function trailingSlashMiddleware(options: {
|
|
29
|
-
rootConfig: RootConfig;
|
|
30
|
-
}): (req: Request, res: Response, next: NextFunction) => void;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Middleware for parsing multipart file uploads that's compatible with the dev
|
|
34
|
-
* server and Firebase Functions.
|
|
35
|
-
*
|
|
36
|
-
* Context:
|
|
37
|
-
* https://stackoverflow.com/questions/47242340/how-to-perform-an-http-file-upload-using-express-on-cloud-functions-for-firebase
|
|
38
|
-
*/
|
|
39
|
-
declare function multipartMiddleware(options?: {
|
|
40
|
-
maxFileSize?: number;
|
|
41
|
-
}): RequestHandler;
|
|
42
|
-
|
|
43
|
-
export { headersMiddleware, multipartMiddleware, rootProjectMiddleware, trailingSlashMiddleware };
|
package/dist/node.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { P as PodConfig, R as RootConfig } from './types-Cksf99CK.js';
|
|
2
|
-
import { PackageInfo } from 'workspace-tools';
|
|
3
|
-
import { ViteDevServer } from 'vite';
|
|
4
|
-
import 'express';
|
|
5
|
-
import 'preact';
|
|
6
|
-
import './jsx-C8BaDh-4.js';
|
|
7
|
-
import './jsx-dev-runtime-DUJrvx5P.js';
|
|
8
|
-
import 'html-minifier-terser';
|
|
9
|
-
import 'js-beautify';
|
|
10
|
-
|
|
11
|
-
interface ResolvedPodRoute {
|
|
12
|
-
filePath: string;
|
|
13
|
-
relPath: string;
|
|
14
|
-
routePath: string;
|
|
15
|
-
}
|
|
16
|
-
interface ResolvedPodCollection {
|
|
17
|
-
filePath: string;
|
|
18
|
-
relPath: string;
|
|
19
|
-
id: string;
|
|
20
|
-
}
|
|
21
|
-
interface ResolvedPod {
|
|
22
|
-
name: string;
|
|
23
|
-
enabled: boolean;
|
|
24
|
-
mount: string;
|
|
25
|
-
priority: number;
|
|
26
|
-
routesDir?: string;
|
|
27
|
-
elementsDirs: string[];
|
|
28
|
-
bundlesDir?: string;
|
|
29
|
-
collectionsDir?: string;
|
|
30
|
-
translationsDir?: string;
|
|
31
|
-
routeFiles: ResolvedPodRoute[];
|
|
32
|
-
bundleFiles: string[];
|
|
33
|
-
collectionFiles: ResolvedPodCollection[];
|
|
34
|
-
translationFiles: Array<{
|
|
35
|
-
locale: string;
|
|
36
|
-
filePath: string;
|
|
37
|
-
}>;
|
|
38
|
-
config: PodConfig;
|
|
39
|
-
}
|
|
40
|
-
declare function invalidatePodCache(): void;
|
|
41
|
-
declare function collectPods(rootConfig: RootConfig): Promise<ResolvedPod[]>;
|
|
42
|
-
|
|
43
|
-
interface ConfigOptions {
|
|
44
|
-
command: string;
|
|
45
|
-
}
|
|
46
|
-
declare function loadRootConfig(rootDir: string, options: ConfigOptions): Promise<RootConfig>;
|
|
47
|
-
declare function loadRootConfigWithDeps(rootDir: string, options: ConfigOptions): Promise<{
|
|
48
|
-
rootConfig: RootConfig;
|
|
49
|
-
dependencies: string[];
|
|
50
|
-
}>;
|
|
51
|
-
/**
|
|
52
|
-
* Compiles a root.config.ts file to root.config.js.
|
|
53
|
-
*/
|
|
54
|
-
declare function bundleRootConfig(rootDir: string, outPath: string): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Loads a pre-bundled config file from dist/root.config.js.
|
|
57
|
-
*/
|
|
58
|
-
declare function loadBundledConfig(rootDir: string, options: ConfigOptions): Promise<RootConfig>;
|
|
59
|
-
|
|
60
|
-
declare function loadPackageJson(filepath: string): PackageInfo | null;
|
|
61
|
-
/**
|
|
62
|
-
* Returns the top-level monorepo package's deps, if any.
|
|
63
|
-
*/
|
|
64
|
-
declare function getMonorepoPackageDeps(rootDir: string): Record<string, string>;
|
|
65
|
-
/**
|
|
66
|
-
* Flattens package.json deps from the root project dir, taking into account any
|
|
67
|
-
* deps from the monorepo root as well as any `workspace:` deps from within the
|
|
68
|
-
* monorepo.
|
|
69
|
-
*/
|
|
70
|
-
declare function flattenPackageDepsFromMonorepo(rootDir: string, options?: {
|
|
71
|
-
ignore?: Set<string>;
|
|
72
|
-
}): Record<string, string>;
|
|
73
|
-
|
|
74
|
-
interface CreateViteServerOptions {
|
|
75
|
-
/** Override HMR settings. */
|
|
76
|
-
hmr?: boolean;
|
|
77
|
-
/** The port the server will run on. */
|
|
78
|
-
port?: number;
|
|
79
|
-
/** List of files to include in the optimizeDeps.include config. */
|
|
80
|
-
optimizeDeps?: string[];
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Returns a vite dev server.
|
|
84
|
-
*/
|
|
85
|
-
declare function createViteServer(rootConfig: RootConfig, options?: CreateViteServerOptions): Promise<ViteDevServer>;
|
|
86
|
-
/**
|
|
87
|
-
* Shortcut `viteServer.ssrLoadModule()` without starting an actual dev server.
|
|
88
|
-
*/
|
|
89
|
-
declare function viteSsrLoadModule<T = Record<string, any>>(rootConfig: RootConfig, file: string): Promise<T>;
|
|
90
|
-
|
|
91
|
-
export { type ConfigOptions, type CreateViteServerOptions, type ResolvedPod, type ResolvedPodCollection, type ResolvedPodRoute, bundleRootConfig, collectPods, createViteServer, flattenPackageDepsFromMonorepo, getMonorepoPackageDeps, invalidatePodCache, loadBundledConfig, loadPackageJson, loadRootConfig, loadRootConfigWithDeps, viteSsrLoadModule };
|