@ahmedrowaihi/8n-starter 2.2.12 → 2.2.13
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{watch as e,existsSync as n}from"node:fs";import{env as t}from"@/config";export const dynamic="force-static";export function GET(){let o;if("development"!==process.env.NODE_ENV)return new Response("Not found",{status:404});let c=new TextEncoder;return new Response(new ReadableStream({start(r){r.enqueue(c.encode("data: connected\n\n")),n(t.CONTENT_DIR)&&(o=e(t.CONTENT_DIR,{recursive:!0},()=>{try{r.enqueue(c.encode("data: change\n\n"))}catch{o?.close()}}))},cancel(){o?.close()}}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}
|
package/next.config.mjs
CHANGED
|
@@ -3,10 +3,8 @@ const config = {
|
|
|
3
3
|
reactStrictMode: true,
|
|
4
4
|
adapterPath: process.env.NEXT_ADAPTER_PATH,
|
|
5
5
|
|
|
6
|
-
// Prevent heavy server-only packages from being bundled into client chunks
|
|
7
6
|
serverExternalPackages: ["twoslash", "typescript", "gray-matter"],
|
|
8
7
|
|
|
9
|
-
// Static export requires unoptimized images
|
|
10
8
|
images: {
|
|
11
9
|
unoptimized: true,
|
|
12
10
|
},
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"next/navigation";import{useEffect as o,useState as t}from"react";export function DevRefresh(){let i=r(),[a,c]=t("connecting"),[l,s]=t(null);return o(()=>{let e=new EventSource("/api/dev/watch");return e.onopen=()=>{c("connected"),s(null)},e.onerror=()=>c("error"),e.onmessage=e=>{"change"===e.data&&i.refresh()},()=>e.close()},[i]),n("div",{style:{position:"fixed",bottom:12,insetInlineEnd:12,zIndex:9999,background:"#1e1e1e",color:"#fff",borderRadius:8,padding:"6px 10px",fontSize:11,fontFamily:"monospace",display:"flex",alignItems:"center",gap:6,boxShadow:"0 2px 8px rgba(0,0,0,0.4)"},children:[e("span",{style:{color:{connecting:"#f59e0b",connected:"#22c55e",error:"#ef4444"}[a]},children:"●"}),e("span",{children:"live"}),l&&e("span",{style:{color:"#f87171",marginInlineStart:4},children:l})]})}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{watch as e,existsSync as n}from"node:fs";import{env as t}from"@/config";export const dynamic="true"===process.env.NEXT_STATIC_EXPORT?"force-static":"force-dynamic";export function GET(){let o;if("development"!==process.env.NODE_ENV)return new Response("Not found",{status:404});let c=new TextEncoder;return new Response(new ReadableStream({start(r){r.enqueue(c.encode("data: connected\n\n")),n(t.CONTENT_DIR)&&(o=e(t.CONTENT_DIR,{recursive:!0},()=>{try{r.enqueue(c.encode("data: change\n\n"))}catch{o?.close()}}))},cancel(){o?.close()}}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}
|