@bobtail.software/b-ssr 1.0.23 → 1.0.25
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/vite-rpc-plugin.js +9 -4
- package/package.json +1 -1
package/dist/vite-rpc-plugin.js
CHANGED
|
@@ -588,7 +588,7 @@ node_modules`),!r)return;let i=(0,Isr.default)({allowRelativePaths:!0}).add(r);r
|
|
|
588
588
|
`;a.set(Pc.resolve(h),bt)}catch(x){console.error(`[rpc-generator] Error al procesar ${h}:`,{error:x})}}function c(h){let p=Sor(h),f="";return p.length>0&&(f=`args: { ${p.join("; ")} }`),`export declare const ${h.name}: (${[f,"ssrContext?: { req?: FastifyRequest, reply?: FastifyReply }"].filter(Boolean).join(", ")}) => ${h.returnType};`}function l(h,p){return h.length===0?"":`
|
|
589
589
|
let rpcOptionsMap, renderOptionsMap, loaderApiOptionsMap;
|
|
590
590
|
async function getOptionsMaps() {
|
|
591
|
-
if (rpcOptionsMap && renderOptionsMap) return;
|
|
591
|
+
if (rpcOptionsMap && renderOptionsMap && loaderApiOptionsMap) return;
|
|
592
592
|
rpcOptionsMap = new Map();
|
|
593
593
|
renderOptionsMap = new Map();
|
|
594
594
|
loaderApiOptionsMap = new Map();
|
|
@@ -599,9 +599,14 @@ node_modules`),!r)return;let i=(0,Isr.default)({allowRelativePaths:!0}).add(r);r
|
|
|
599
599
|
if (prop === 'addRpcRoute') return (url, options) => rpcOptionsMap.set(url, options);
|
|
600
600
|
if (prop === 'addRenderRoute') return (url, options) => renderOptionsMap.set(url, options);
|
|
601
601
|
if (prop === 'addLoaderRoute') return (url, options) => loaderApiOptionsMap.set(url, options);
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
602
|
+
if (prop === 'register') return (plugin) => {
|
|
603
|
+
if (typeof plugin === 'function') plugin(mockFastify);
|
|
604
|
+
return mockFastify;
|
|
605
|
+
};
|
|
606
|
+
if (prop === 'decorate' || prop === 'decorateReply' || prop === 'addHook' || prop === 'after') {
|
|
607
|
+
return () => mockFastify;
|
|
608
|
+
}
|
|
609
|
+
return () => mockFastify;
|
|
605
610
|
}
|
|
606
611
|
});
|
|
607
612
|
if (routeModule.default) await routeModule.default(mockFastify);
|
package/package.json
CHANGED