@joystick.js/node-canary 0.0.0-canary.366 → 0.0.0-canary.367

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.
@@ -1 +1 @@
1
- import w from"fs";import p from"../../../lib/dynamic_import.js";import c from"../generate_joystick_error_page.js";import k from"../../../lib/get_joystick_build_path.js";import j from"../../../lib/get_translations.js";import x from"./get_url.js";import _ from"../../../lib/path_exists.js";import v from"../../ssr/index.js";import z from"../../../lib/get_browser_safe_request.js";const{readFile:A}=w.promises,i=k(),D=()=>A("index.html","utf-8"),T=(s,e,f,d={})=>{e.render=async(n="",t={})=>{const u=n?.substring(0,1)==="/"?n?.replace("/",""):n,r=t?.layout?.substring(0,1)==="/"?t?.layout?.replace("/",""):t?.layout,a=`${i}${u}`,o=t?.layout?`${i}${r}`:null;if(!await _(a))return e.status(404).send(c({type:"page_not_found",path:`res.render('${a}')`,frame:null,stack:`A page component at the path ${a} could not be found.`}));if(o&&!await _(o))return e.status(404).send(c({type:"layout_not_found",path:`res.render('${a}', { layout: '${r}' })`,frame:null,stack:`A layout component at the path ${t?.layout} could not be found.`}));const l=await p(`${a}?v=${new Date().getTime()}`),h=o?await p(`${o}?v=${new Date().getTime()}`):null,m={...t?.props||{}};o&&(m.page=l);const y=await D(),g=await j({joystick_build_path:i,render_component_path:n,req:s}),$=x(s),b=await v({api_schema:d?.options?.api,attributes:t?.attributes,base_html:y,component_options:{props:m,translations:g,url:$},component_to_render:h||l,head:t?.head,render_component_path:u,render_layout_path:r,req:z(s)});return e.status(200).send(b)},f()};var J=T;export{J as default};
1
+ import w from"fs";import p from"../../../lib/dynamic_import.js";import c from"../generate_joystick_error_page.js";import k from"../../../lib/get_joystick_build_path.js";import j from"../../../lib/get_translations.js";import x from"./get_url.js";import _ from"../../../lib/path_exists.js";import v from"../../ssr/index.js";import"../../../lib/get_browser_safe_request.js";const{readFile:z}=w.promises,i=k(),A=()=>z("index.html","utf-8"),D=(s,e,f,d={})=>{e.render=async(n="",t={})=>{const u=n?.substring(0,1)==="/"?n?.replace("/",""):n,r=t?.layout?.substring(0,1)==="/"?t?.layout?.replace("/",""):t?.layout,a=`${i}${u}`,o=t?.layout?`${i}${r}`:null;if(!await _(a))return e.status(404).send(c({type:"page_not_found",path:`res.render('${a}')`,frame:null,stack:`A page component at the path ${a} could not be found.`}));if(o&&!await _(o))return e.status(404).send(c({type:"layout_not_found",path:`res.render('${a}', { layout: '${r}' })`,frame:null,stack:`A layout component at the path ${t?.layout} could not be found.`}));const l=await p(`${a}?v=${new Date().getTime()}`),h=o?await p(`${o}?v=${new Date().getTime()}`):null,m={...t?.props||{}};o&&(m.page=l);const y=await A(),g=await j({joystick_build_path:i,render_component_path:n,req:s}),$=x(s),b=await v({api_schema:d?.options?.api,attributes:t?.attributes,base_html:y,component_options:{props:m,translations:g,url:$},component_to_render:h||l,head:t?.head,render_component_path:u,render_layout_path:r,req:s});return e.status(200).send(b)},f()};var K=D;export{K as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joystick.js/node-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.366",
4
+ "version": "0.0.0-canary.367",
5
5
  "description": "The Node.js framework for Joystick.",
6
6
  "main": "./dist/index.js",
7
7
  "scripts": {
@@ -81,7 +81,7 @@ const render_middleware = (req, res, next, app_instance = {}) => {
81
81
  head: render_options?.head,
82
82
  render_component_path: sanitized_render_component_path,
83
83
  render_layout_path: sanitized_render_layout_path,
84
- req: get_browser_safe_request(req),
84
+ req,
85
85
  });
86
86
 
87
87
  return res.status(200).send(html);