@coreframe/dashboard 0.4.0-next.4 → 0.4.0
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/README.md +144 -23
- package/dist/package/access.d.ts +7 -0
- package/dist/package/access.js +30 -0
- package/dist/package/app/root.js +1 -1
- package/dist/package/app/sculpted-runtime.js +1 -0
- package/dist/package/app/shell.js +1 -1
- package/dist/package/app-client.d.ts +5 -4
- package/dist/package/app-client.js +1 -1
- package/dist/package/build.js +2 -2
- package/dist/package/config.d.ts +15 -3
- package/dist/package/index.d.ts +3 -3
- package/dist/package/node-fetch-adapter.js +1 -1
- package/dist/package/server.d.ts +8 -2
- package/dist/package/server.js +1 -1
- package/dist/package/types.d.ts +1 -17
- package/dist/package/web/styled-system/css/conditions.js +1 -1
- package/dist/package/web/styled-system/helpers.js +1 -1
- package/dist/package/web/styled-system/recipes/dashboard-button.js +1 -1
- package/dist/package/web/styled-system/recipes/dashboard-status.js +1 -1
- package/dist/package/web/styled-system/recipes/runtime.js +1 -1
- package/dist/package/web/ui/index.d.ts +1 -1
- package/dist/package/web/ui/styles.js +1 -1
- package/dist/package/web-shell/index.d.ts +2 -1
- package/dist/package/web-shell/index.js +1 -1
- package/dist/package/web-shell/menu.d.ts +19 -0
- package/dist/package/web-shell/menu.js +1 -0
- package/dist/package/web-shell/shell.d.ts +7 -6
- package/dist/package/web-shell/shell.js +6 -1
- package/dist/package/worker.d.ts +3 -3
- package/dist/package/worker.js +1 -1
- package/package.json +16 -33
- package/dist/package/plugins/diagnostics/api/contract.d.ts +0 -10
- package/dist/package/plugins/diagnostics/api/contract.js +0 -1
- package/dist/package/plugins/diagnostics/api/local.d.ts +0 -10
- package/dist/package/plugins/diagnostics/api/local.js +0 -1
- package/dist/package/plugins/diagnostics/api/worker.d.ts +0 -8
- package/dist/package/plugins/diagnostics/api/worker.js +0 -1
- package/dist/package/plugins/diagnostics/index.d.ts +0 -30
- package/dist/package/plugins/diagnostics/index.js +0 -1
- package/dist/package/plugins/diagnostics/web/queries.js +0 -1
- package/dist/package/plugins/diagnostics/web.d.ts +0 -4
- package/dist/package/plugins/diagnostics/web.js +0 -1
- package/dist/package/shell.css +0 -390
- package/dist/package/styled-css.js +0 -1
- package/dist/package/web/dashboard/dashboard-page.js +0 -1
- package/dist/package/web/dashboard/dashboard-section.js +0 -1
- package/dist/package/web/dashboard/dashboard.style.js +0 -1
- package/dist/package/web/dashboard/deployed-dashboard-page.js +0 -1
- package/dist/package/web/dashboard/findings.js +0 -1
- package/dist/package/web/dashboard/worker-environment.js +0 -1
- package/dist/package/web/root.style.js +0 -1
- package/dist/package/web/styled-system/css/css.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRecipe as e}from"./runtime.js";const t=e({name:`dashboardStatus`,className:`dashboard-status`,defaultVariants:{tone:`neutral`},variantMap:{tone:[`
|
|
1
|
+
import{createRecipe as e}from"./runtime.js";const t=e({name:`dashboardStatus`,className:`dashboard-status`,defaultVariants:{tone:`neutral`},variantMap:{tone:[`neutral`,`info`,`success`,`warning`,`danger`]}});export{t as dashboardStatus};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createSerializeCss as e,getCompoundVariantClassNames as t,getSlotCompoundVariant as n,memo as r,splitProps as i,uniq as a,withDefaults as o,withoutSpace as s}from"../helpers.js";import{breakpointKeys as c,finalizeConditions as l,sortConditions as u}from"../css/conditions.js";import{cx as d}from"../css/cx.js";function f(e){let t=e.variantMap??{};return{name:e.name,className:e.className??e.name,slots:e.slots??[],variantMap:t,variantKeys:Object.keys(t),defaults:e.defaultVariants??{},compounds:e.compoundVariants??[]}}function p(n){let{name:i,className:a,variantMap:p,variantKeys:m,defaults:_,compounds:v}=f(n),y=e({hash:!1,conditions:{shift:u,finalize:l,breakpoints:{keys:c}},utility:{prefix:null,toHash(e,t){return t(e.join(`:`))},transform(e,t){return{className:t===`__ignore__`?a:`${a}--${e}_${s(t)}`}}}}),b=e=>e;function x(e={}){return{[a]:`__ignore__`,...o(_,e)}}function S(e){if(v.length!==0)for(let t of m){let n=e[t];if(typeof n==`object`&&n)throw Error(`[recipe:${a}:${t}] Conditions are not supported when using compound variants.`)}}function C(e){return t(v,x(e),b)}let w=g(r(function(e={},t=!0){S(e);let n=y(x(e));return t?d(n,C(e)):n}),i,m,p,x);return w.__recipe__=!0,w.__getCompoundVariantClasses__=C,w.merge=function(e){return h(w,e)},w}function m(e){let{name:t,className:i,slots:a,variantMap:s,variantKeys:c,defaults:l,compounds:u}=f(e),d=a.map(function(e){return[e,p({name:t,className:`${i}__${e}`,variantMap:s,defaultVariants:l,compoundVariants:n(u,e)})]}),m=r(function(e={}){let t={};for(let[n,r]of d)t[n]=r(e);return t});return g(m,t,c,s,function(e={}){return o(l,e)}),m.__recipe__=!1,m.classNameMap={},m}function h(e,t){if(e&&!t)return e;if(!e&&t)return t;function n(...n){let r=e(...n),i=t(...n);return r&&i?`${r} ${i}`:r||i}let r=a(e.variantKeys,t.variantKeys),i={};for(let n of r)i[n]=a(e.variantMap[n],t.variantMap[n]);return g(n,`${e.__name__} ${t.__name__}`,r,i,function(e){return e}),n.__recipe__=!0,n}function g(e,t,n,r,a){return e.__name__=t,e.raw=function(e){return e},e.variantKeys=n,e.variantMap=r,e.splitVariantProps=function(e){return i(e,n)},e.getVariantProps=a,e}export{p as createRecipe,m as createSlotRecipe};
|
|
@@ -2,7 +2,7 @@ import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactElemen
|
|
|
2
2
|
|
|
3
3
|
//#region src/web/ui/index.d.ts
|
|
4
4
|
interface PageProps extends HTMLAttributes<HTMLDivElement> {}
|
|
5
|
-
/**
|
|
5
|
+
/** Optional content layout for a dashboard route. Pages own their headings and content insets. */
|
|
6
6
|
declare function Page({
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cx as e}from"../styled-system/css/cx.js";import
|
|
1
|
+
import{cx as e}from"../styled-system/css/cx.js";import{dashboardButton as t}from"../styled-system/recipes/dashboard-button.js";import{dashboardConfirmDialog as n}from"../styled-system/recipes/dashboard-confirm-dialog.js";import{dashboardEmptyState as r}from"../styled-system/recipes/dashboard-empty-state.js";import{dashboardErrorState as i}from"../styled-system/recipes/dashboard-error-state.js";import{dashboardField as a}from"../styled-system/recipes/dashboard-field.js";import{dashboardPage as o}from"../styled-system/recipes/dashboard-page.js";import{dashboardSection as s}from"../styled-system/recipes/dashboard-section.js";import{dashboardStatus as c}from"../styled-system/recipes/dashboard-status.js";import{dashboardTabs as l}from"../styled-system/recipes/dashboard-tabs.js";const u={button:t,confirmDialog:n,emptyState:r,errorState:i,field:a,page:o,section:s,status:c,tabs:l};export{e as cx,u as styles};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { DashboardMenu, DashboardMenuProps } from "./menu.js";
|
|
1
2
|
import { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardShell, DashboardShellProps } from "./shell.js";
|
|
2
|
-
export { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardShell, type DashboardShellProps };
|
|
3
|
+
export { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardMenu, type DashboardMenuProps, DashboardShell, type DashboardShellProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DashboardEmptyState as
|
|
1
|
+
import{DashboardMenu as e}from"./menu.js";import{DashboardEmptyState as t,DashboardErrorBoundary as n,DashboardIndexRedirect as r,DashboardShell as i}from"./shell.js";export{t as DashboardEmptyState,n as DashboardErrorBoundary,r as DashboardIndexRedirect,e as DashboardMenu,i as DashboardShell};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DashboardPageManifestEntry } from "../config.js";
|
|
2
|
+
|
|
3
|
+
//#region src/web-shell/menu.d.ts
|
|
4
|
+
interface DashboardNavigation {
|
|
5
|
+
application?: {
|
|
6
|
+
name: string;
|
|
7
|
+
favicon: string;
|
|
8
|
+
};
|
|
9
|
+
pages: readonly DashboardPageManifestEntry[];
|
|
10
|
+
}
|
|
11
|
+
interface DashboardMenuProps {
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Logo and navigation popover. Place inside a dashboard page to own its position. */
|
|
15
|
+
declare function DashboardMenu({
|
|
16
|
+
className
|
|
17
|
+
}: DashboardMenuProps): import("react").JSX.Element | null;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DashboardMenu, DashboardMenuProps, DashboardNavigation };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NavLink as e,useLocation as t}from"react-router";import{createContext as n,useContext as r,useEffect as i,useId as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=n(void 0);function d({className:e}){let n=r(u),i=t();if(!n)throw Error(`DashboardMenu must be rendered inside a dashboard page.`);return n.pages.length<=1?null:c(f,{navigation:n,className:e},i.key)}function f({navigation:t,className:n}){let r=a(),u=o(null),d=o(null),f=o(null),p=o(void 0),[m,h]=s(!1);i(()=>{if(!m)return;if(p.current){let e=f.current?.querySelectorAll(`a`);(p.current===`first`?e?.[0]:e?.[e.length-1])?.focus(),p.current=void 0}function e(e){e.target instanceof Node&&!u.current?.contains(e.target)&&h(!1)}function t(e){e.key===`Escape`&&(h(!1),u.current?.contains(document.activeElement)&&d.current?.focus())}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[m]);let{application:g,pages:_}=t;return l(`div`,{ref:u,className:[`coreframe-dashboard__menu`,n].filter(Boolean).join(` `),onPointerEnter:e=>{e.pointerType!==`touch`&&h(!0)},onPointerLeave:()=>{u.current?.contains(document.activeElement)||h(!1)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||h(!1)},children:[c(`button`,{ref:d,type:`button`,className:`coreframe-dashboard__logo`,"aria-label":`Dashboard navigation`,"aria-controls":r,"aria-expanded":m,onClick:()=>h(e=>!e),onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=e.key===`ArrowDown`?`first`:`last`;if(m){let e=f.current?.querySelectorAll(`a`);(t===`first`?e?.[0]:e?.[e.length-1])?.focus()}else p.current=t,h(!0)},children:g?c(`img`,{src:g.favicon,alt:``,className:`coreframe-dashboard__mark`}):c(`span`,{"aria-hidden":`true`,children:`C`})}),m?c(`div`,{className:`coreframe-dashboard__popover`,children:c(`nav`,{ref:f,id:r,className:`coreframe-dashboard__navigation`,"aria-label":`Dashboard`,children:c(`ul`,{className:`coreframe-dashboard__navigation-list`,children:_.map(t=>{let n=t.iconData;return c(`li`,{children:l(e,{className:`coreframe-dashboard__navigation-link`,to:`/${t.path}`,onClick:()=>{h(!1),d.current?.focus()},children:[c(`svg`,{"aria-hidden":`true`,className:`coreframe-dashboard__navigation-icon`,width:`20`,height:`20`,viewBox:`0 0 ${n.width} ${n.height}`,fill:`currentColor`,dangerouslySetInnerHTML:{__html:n.body}}),c(`span`,{className:`coreframe-dashboard__navigation-text`,children:t.title})]})},t.id)})})})}):null]})}export{d as DashboardMenu,u as DashboardNavigationContext};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DashboardNavigation } from "./menu.js";
|
|
2
2
|
|
|
3
3
|
//#region src/web-shell/shell.d.ts
|
|
4
|
-
interface DashboardShellProps {
|
|
5
|
-
pages: readonly DashboardPageManifestEntry[];
|
|
6
|
-
}
|
|
4
|
+
interface DashboardShellProps extends DashboardNavigation {}
|
|
7
5
|
declare function DashboardShell({
|
|
8
|
-
pages
|
|
6
|
+
pages,
|
|
7
|
+
application
|
|
9
8
|
}: DashboardShellProps): import("react").JSX.Element;
|
|
10
9
|
declare function DashboardIndexRedirect({
|
|
11
10
|
pages
|
|
12
11
|
}: DashboardShellProps): import("react").JSX.Element;
|
|
13
|
-
declare function DashboardEmptyState(
|
|
12
|
+
declare function DashboardEmptyState({
|
|
13
|
+
pages
|
|
14
|
+
}: Partial<DashboardShellProps>): import("react").JSX.Element;
|
|
14
15
|
declare function DashboardErrorBoundary(): import("react").JSX.Element;
|
|
15
16
|
//#endregion
|
|
16
17
|
export { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardShell, DashboardShellProps };
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DashboardMenu as e,DashboardNavigationContext as t}from"./menu.js";import{Link as n,Navigate as r,Outlet as i,isRouteErrorResponse as a,useLocation as o,useRouteError as s}from"react-router";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({pages:n,application:r}){let a=o().pathname.split(`/`).filter(Boolean)[0],s=n.find(e=>e.path===a)??(a?void 0:n[0]);return l(t,{value:{pages:n,application:r},children:[s?.layout===`standalone`?null:c(e,{className:`coreframe-dashboard__floating-navigation`}),c(i,{})]})}function d({pages:e}){let t=e[0];return t&&e.some(e=>e.source===`app`)?c(r,{replace:!0,to:`/${t.path}`}):c(f,{pages:e})}function f({pages:e=[]}){return l(`main`,{className:`coreframe-dashboard__introduction`,children:[c(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Coreframe Dashboard`}),c(`h1`,{children:`Your dashboard starts here`}),c(`p`,{children:`A space for your app’s internal tools. Build ordinary React Router pages with your own content, layout, and API access.`}),e.length>0?l(`section`,{children:[c(`h2`,{children:`Installed tools`}),c(`ul`,{children:e.map(e=>c(`li`,{children:c(n,{to:`/${e.path}`,children:e.title})},e.id))})]}):null,l(`section`,{children:[c(`h2`,{children:`Add your first page`}),l(`p`,{children:[`Create `,c(`code`,{children:`dashboard/pages/overview/route.tsx`}),`:`]}),c(`pre`,{children:c(`code`,{children:`export default function Overview() {
|
|
2
|
+
return <main><h1>Overview</h1></main>
|
|
3
|
+
}`})}),l(`p`,{children:[`Add an adjacent `,c(`code`,{children:`page.yaml`}),` with a`,` `,c(`a`,{href:`https://icones.js.org/collection/tabler`,children:`Tabler icon`}),` and optional title:`]}),c(`pre`,{children:c(`code`,{children:`icon: home
|
|
4
|
+
title: Overview`})}),l(`p`,{children:[`The page becomes available at `,c(`code`,{children:`/__dashboard/overview`}),`. This introduction disappears once an app-owned page exists.`]})]}),l(`section`,{children:[c(`h2`,{children:`Make it yours`}),l(`p`,{children:[`Pages own their headings and spacing. Customize default styles in`,` `,c(`code`,{children:`dashboard/panda.config.ts`}),`. A logo menu appears when there is more than one page.`]}),l(`p`,{children:[`Register optional reusable plugins in `,c(`code`,{children:`dashboard/dashboard.config.ts`}),`. App-owned pages are discovered automatically and do not need registration.`]})]}),l(`section`,{children:[c(`h2`,{children:`Disable the dashboard build`}),l(`p`,{children:[`If you do not need the dashboard, add this setting to the existing`,` `,c(`code`,{children:`defineConfig`}),` call in your project’s `,c(`code`,{children:`coreframe.config.ts`}),`:`]}),c(`pre`,{children:c(`code`,{children:`dashboard: {
|
|
5
|
+
enabled: false,
|
|
6
|
+
},`})}),c(`p`,{children:`This skips the dashboard bundle and its local development server. Remove the setting to enable the dashboard again.`})]})]})}function p(){let e=s(),t=a(e)&&e.status===404,r=import.meta.env.DEV&&e instanceof Error?e.message:t?`The requested dashboard page does not exist.`:`The dashboard hit an unexpected error.`;return l(`main`,{className:`coreframe-dashboard__state`,children:[c(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Coreframe Dashboard`}),c(`h1`,{children:t?`Page not found`:`Dashboard unavailable`}),c(`p`,{children:r}),c(n,{className:`coreframe-dashboard__button`,to:`/`,children:`Go to dashboard`})]})}export{f as DashboardEmptyState,p as DashboardErrorBoundary,d as DashboardIndexRedirect,u as DashboardShell};
|
package/dist/package/worker.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DashboardAccess } from "./access.js";
|
|
1
2
|
import { DashboardPluginRegistration } from "./api/contract.js";
|
|
2
3
|
import { DashboardLink, DashboardReleaseIdentity, DeployedConfigurationEntry } from "./types.js";
|
|
3
4
|
|
|
@@ -11,7 +12,6 @@ type DashboardWorkerEnv = {
|
|
|
11
12
|
tag?: string;
|
|
12
13
|
timestamp?: string;
|
|
13
14
|
};
|
|
14
|
-
DASHBOARD_PASSWORD?: string;
|
|
15
15
|
DEPLOY_ENV?: "production" | "staging";
|
|
16
16
|
POSTHOG_RELEASE?: string;
|
|
17
17
|
};
|
|
@@ -31,7 +31,7 @@ type DashboardBuildMetadata = {
|
|
|
31
31
|
type DashboardWorkerOptions = {
|
|
32
32
|
plugins: readonly DashboardPluginRegistration<DashboardWorkerHostData>[];
|
|
33
33
|
};
|
|
34
|
-
type DashboardWorkerHandler = (request: Request, env: DashboardWorkerEnv) => Promise<Response> | null;
|
|
34
|
+
type DashboardWorkerHandler = (request: Request, env: DashboardWorkerEnv, access: DashboardAccess) => Promise<Response> | null;
|
|
35
35
|
type DashboardWorkerHostData = {
|
|
36
36
|
environment: "production" | "staging";
|
|
37
37
|
release: DashboardReleaseIdentity;
|
|
@@ -39,6 +39,6 @@ type DashboardWorkerHostData = {
|
|
|
39
39
|
links: readonly DashboardLink[];
|
|
40
40
|
};
|
|
41
41
|
declare function createWorkerHandler(options: DashboardWorkerOptions): DashboardWorkerHandler;
|
|
42
|
-
declare function handleDashboardRequest<Env extends DashboardWorkerEnv>(request: Request, env: Env, options: DashboardWorkerOptions): Promise<Response> | null;
|
|
42
|
+
declare function handleDashboardRequest<Env extends DashboardWorkerEnv>(request: Request, env: Env, options: DashboardWorkerOptions, access: DashboardAccess): Promise<Response> | null;
|
|
43
43
|
//#endregion
|
|
44
44
|
export { DashboardBuildMetadata, DashboardWorkerEnv, DashboardWorkerHandler, DashboardWorkerHostData, DashboardWorkerOptions, createWorkerHandler, handleDashboardRequest };
|
package/dist/package/worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dashboardAccessResponse as e}from"./access.js";import{createDashboardPluginDispatcher as t}from"./api/dispatcher.js";import{getDashboardRequestId as n,isSameOriginDashboardMutation as r}from"./host-policy.js";const i=`/__dashboard`,a=`${i}/api`,o=new WeakMap;function s(e){let r=t(e.plugins,{getRequestId:n});return(e,t,n)=>{let i=new URL(e.url);return!f(i.pathname)||!t.DEPLOY_ENV?null:l(e,t,i,t.DEPLOY_ENV,r,n)}}function c(e,t,n,r){if(!f(new URL(e.url).pathname)||!t.DEPLOY_ENV)return null;let i=n.plugins,a=o.get(i);return a||(a=s(n),o.set(i,a)),a(e,t,r)}async function l(t,n,o,s,c,l){let d=e(t,l);if(d)return d;if(!r(t.method,t.headers.get(`origin`),o.origin))return m({error:{code:`invalid_input`}},403);if(o.pathname.startsWith(`${a}/plugins/`))return c(t,u(t,n,s));if(o.pathname===a||o.pathname.startsWith(`${a}/`))return m({error:`Not found`},404);if(o.pathname===i)return o.pathname=`${i}/`,Response.redirect(o,302);if(t.method!==`GET`&&t.method!==`HEAD`)return new Response(`Method not allowed`,{headers:{"cache-control":`no-store`},status:405});if(!n.ASSETS)return new Response(`Dashboard unavailable`,{headers:{"cache-control":`no-store`},status:503});(o.pathname===`${i}/`||!o.pathname.slice(13).includes(`.`))&&(o.pathname=`${i}/index.html`);let f=await n.ASSETS.fetch(new Request(o,t));if(o.pathname===`${i}/index.html`&&f.status===307){let e=f.headers.get(`location`),r=e?new URL(e,o):void 0;r?.origin===o.origin&&(r.pathname===i||r.pathname===`${i}/`)&&(await f.body?.cancel(),f=await n.ASSETS.fetch(new Request(r,t)))}let p=new Headers(f.headers);return p.set(`cache-control`,`private, no-store`),new Response(t.method===`HEAD`?null:f.body,{headers:p,status:f.status,statusText:f.statusText})}function u(e,t,n){let r=d(),i=t,a=r.configuration.filter(e=>e.requiredIn.includes(n)).map(e=>({description:e.description,kind:e.kind,name:e.name,status:p(i[e.name])?`configured`:`missing`})),o=[],s=r.deployUrls[n];return s?o.push({href:s,id:`application`,label:`Application`}):o.push({href:new URL(`/`,e.url).href,id:`application`,label:`Application`}),{environment:n,release:{applicationName:r.applicationName,applicationVersion:r.applicationVersion,cloudflareVersionId:t.CF_VERSION_METADATA?.id,cloudflareVersionTag:t.CF_VERSION_METADATA?.tag,cloudflareVersionTimestamp:t.CF_VERSION_METADATA?.timestamp,commit:r.commit,coreframeVersion:r.coreframeVersion,releaseName:t.POSTHOG_RELEASE},configuration:a,links:o}}function d(){return typeof __COREFRAME_DASHBOARD_BUILD__<`u`?__COREFRAME_DASHBOARD_BUILD__:{applicationName:`Coreframe application`,configuration:[],deployUrls:{}}}function f(e){return e===i||e.startsWith(`${i}/`)}function p(e){return typeof e==`string`?e.trim().length>0:e!=null}function m(e,t=200){return Response.json(e,{headers:{"cache-control":`no-store`},status:t})}export{s as createWorkerHandler,c as handleDashboardRequest};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreframe/dashboard",
|
|
3
|
-
"version": "0.4.0
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Reusable dashboard composition, shell, plugin, and authenticated runtime for Coreframe apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,30 +56,14 @@
|
|
|
56
56
|
"types": "./dist/package/app/index.d.ts",
|
|
57
57
|
"default": "./dist/package/app/index.js"
|
|
58
58
|
},
|
|
59
|
-
"./
|
|
60
|
-
"types": "./dist/package/
|
|
61
|
-
"default": "./dist/package/
|
|
62
|
-
}
|
|
63
|
-
"./plugins/diagnostics/web": {
|
|
64
|
-
"types": "./dist/package/plugins/diagnostics/web.d.ts",
|
|
65
|
-
"default": "./dist/package/plugins/diagnostics/web.js"
|
|
66
|
-
},
|
|
67
|
-
"./plugins/diagnostics/api/contract": {
|
|
68
|
-
"types": "./dist/package/plugins/diagnostics/api/contract.d.ts",
|
|
69
|
-
"default": "./dist/package/plugins/diagnostics/api/contract.js"
|
|
70
|
-
},
|
|
71
|
-
"./plugins/diagnostics/api/local": {
|
|
72
|
-
"types": "./dist/package/plugins/diagnostics/api/local.d.ts",
|
|
73
|
-
"default": "./dist/package/plugins/diagnostics/api/local.js"
|
|
74
|
-
},
|
|
75
|
-
"./plugins/diagnostics/api/worker": {
|
|
76
|
-
"types": "./dist/package/plugins/diagnostics/api/worker.d.ts",
|
|
77
|
-
"default": "./dist/package/plugins/diagnostics/api/worker.js"
|
|
78
|
-
},
|
|
79
|
-
"./shell.css": "./dist/package/shell.css"
|
|
59
|
+
"./access": {
|
|
60
|
+
"types": "./dist/package/access.d.ts",
|
|
61
|
+
"default": "./dist/package/access.js"
|
|
62
|
+
}
|
|
80
63
|
},
|
|
81
64
|
"dependencies": {
|
|
82
65
|
"@fontsource-variable/inter": "^5.2.8",
|
|
66
|
+
"@iconify-json/tabler": "^1.2.43",
|
|
83
67
|
"@tanstack/react-query": "^5.101.2",
|
|
84
68
|
"react": "19.2.8",
|
|
85
69
|
"react-dom": "19.2.8",
|
|
@@ -87,29 +71,28 @@
|
|
|
87
71
|
"rouzer": "^6.0.1",
|
|
88
72
|
"yaml": "^2.9.0",
|
|
89
73
|
"zod": "^4.4.3",
|
|
90
|
-
"@coreframe/
|
|
91
|
-
"@coreframe/diagnostics": "0.2.4-next.0",
|
|
92
|
-
"@coreframe/lib": "^0.2.16-next.3"
|
|
74
|
+
"@coreframe/lib": "^0.3.0"
|
|
93
75
|
},
|
|
94
76
|
"devDependencies": {
|
|
95
|
-
"@pandacss/dev": "2.
|
|
96
|
-
"@pandacss/preset-base": "2.
|
|
97
|
-
"@pandacss/preset-panda": "2.
|
|
77
|
+
"@pandacss/dev": "2.4.0",
|
|
78
|
+
"@pandacss/preset-base": "2.4.0",
|
|
79
|
+
"@pandacss/preset-panda": "2.4.0",
|
|
98
80
|
"@types/node": "^26.1.0",
|
|
99
81
|
"@types/react": "19.2.18",
|
|
100
82
|
"@types/react-dom": "19.2.4",
|
|
101
83
|
"jsdom": "^29.1.1",
|
|
84
|
+
"miniflare": "4.20260730.0",
|
|
102
85
|
"tsdown": "0.22.3",
|
|
103
86
|
"typescript": "6.0.3",
|
|
104
|
-
"vite": "^8.
|
|
87
|
+
"vite": "^8.3.5",
|
|
105
88
|
"vitest": "^4.1.10",
|
|
106
|
-
"@coreframe/panda": "0.1.
|
|
89
|
+
"@coreframe/panda": "0.1.15"
|
|
107
90
|
},
|
|
108
91
|
"scripts": {
|
|
109
|
-
"build": "pnpm
|
|
92
|
+
"build": "pnpm build:server",
|
|
110
93
|
"codegen": "panda codegen",
|
|
111
|
-
"build:server": "tsdown
|
|
112
|
-
"test": "vitest run --reporter=minimal",
|
|
94
|
+
"build:server": "tsdown",
|
|
95
|
+
"test": "NODE_OPTIONS=--no-experimental-webstorage vitest run --reporter=minimal",
|
|
113
96
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
114
97
|
"format": "oxlint --fix && oxfmt",
|
|
115
98
|
"lint": "oxlint"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DashboardPluginApi, DashboardQuery } from "../../../api/contract.js";
|
|
2
|
-
import { DashboardPayload } from "../../../types.js";
|
|
3
|
-
//#region src/plugins/diagnostics/api/contract.d.ts
|
|
4
|
-
/** The typed operation contract shared by the diagnostics page and runtime targets. */
|
|
5
|
-
declare const diagnosticsApi: DashboardPluginApi<"diagnostics", {
|
|
6
|
-
readonly overview: DashboardQuery<undefined, DashboardPayload>;
|
|
7
|
-
}, {}>;
|
|
8
|
-
type DiagnosticsApi = typeof diagnosticsApi;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { DiagnosticsApi, diagnosticsApi as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{api as e,query as t}from"../../../api/contract.js";import{z as n}from"zod";const r=e({id:`diagnostics`,queries:{overview:t({output:n.custom()})},commands:{}});export{r as default};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DashboardInitializationContext, DashboardPluginImplementation } from "../../../api/contract.js";
|
|
2
|
-
import { DashboardLocalHostData } from "../../../server.js";
|
|
3
|
-
import { DiagnosticsApi } from "./contract.js";
|
|
4
|
-
|
|
5
|
-
//#region src/plugins/diagnostics/api/local.d.ts
|
|
6
|
-
declare function createImplementation({
|
|
7
|
-
host
|
|
8
|
-
}: DashboardInitializationContext<DashboardLocalHostData>): DashboardPluginImplementation<DiagnosticsApi, DashboardLocalHostData>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { createImplementation };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineImplementation as e}from"../../../api/contract.js";import t from"./contract.js";import{inspectWorkerEnvironment as n}from"@coreframe/deploy";import{runDiagnostics as r}from"@coreframe/diagnostics";function i({host:i}){return e(t,{queries:{async overview(){let[e,t]=await Promise.all([r({projectRoot:i.projectRoot,environment:`development`,env:process.env}),n({cwd:i.projectRoot})]);return{mode:`local`,diagnostics:e,workerEnvironment:t}}},commands:{}})}export{i as createImplementation};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DashboardInitializationContext, DashboardPluginImplementation } from "../../../api/contract.js";
|
|
2
|
-
import { DashboardWorkerHostData } from "../../../worker.js";
|
|
3
|
-
import { DiagnosticsApi } from "./contract.js";
|
|
4
|
-
|
|
5
|
-
//#region src/plugins/diagnostics/api/worker.d.ts
|
|
6
|
-
declare function createImplementation(_context: DashboardInitializationContext<DashboardWorkerHostData>): DashboardPluginImplementation<DiagnosticsApi, DashboardWorkerHostData>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { createImplementation };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineImplementation as e}from"../../../api/contract.js";import t from"./contract.js";function n(n){return e(t,{queries:{overview({host:e}){return{mode:`deployed`,environment:e.environment,release:e.release,configuration:[...e.configuration],links:[...e.links]}}},commands:{}})}export{n as createImplementation};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { DashboardPluginApi, DashboardQuery } from "../../api/contract.js";
|
|
2
|
-
import { DashboardPayload } from "../../types.js";
|
|
3
|
-
//#region src/plugins/diagnostics/index.d.ts
|
|
4
|
-
declare const diagnosticsPlugin: {
|
|
5
|
-
readonly id: "diagnostics";
|
|
6
|
-
readonly navigation: {
|
|
7
|
-
readonly path: "diagnostics";
|
|
8
|
-
readonly title: "Production readiness";
|
|
9
|
-
readonly description: "Review launch readiness, deployment configuration, and project health.";
|
|
10
|
-
};
|
|
11
|
-
readonly pageModule: "@coreframe/dashboard/plugins/diagnostics/web";
|
|
12
|
-
readonly api: DashboardPluginApi<"diagnostics", {
|
|
13
|
-
readonly overview: DashboardQuery<undefined, DashboardPayload>;
|
|
14
|
-
}, {}>;
|
|
15
|
-
};
|
|
16
|
-
/** Registers Coreframe's built-in production-readiness dashboard. */
|
|
17
|
-
declare function diagnostics(): {
|
|
18
|
-
readonly id: "diagnostics";
|
|
19
|
-
readonly navigation: {
|
|
20
|
-
readonly path: "diagnostics";
|
|
21
|
-
readonly title: "Production readiness";
|
|
22
|
-
readonly description: "Review launch readiness, deployment configuration, and project health.";
|
|
23
|
-
};
|
|
24
|
-
readonly pageModule: "@coreframe/dashboard/plugins/diagnostics/web";
|
|
25
|
-
readonly api: DashboardPluginApi<"diagnostics", {
|
|
26
|
-
readonly overview: DashboardQuery<undefined, DashboardPayload>;
|
|
27
|
-
}, {}>;
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
export { diagnostics, diagnosticsPlugin };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{definePlugin as e}from"../../config.js";import t from"./api/contract.js";const n=e({id:`diagnostics`,navigation:{path:`diagnostics`,title:`Production readiness`,description:`Review launch readiness, deployment configuration, and project health.`},pageModule:`@coreframe/dashboard/plugins/diagnostics/web`,api:t},{apiModule:`@coreframe/dashboard/plugins/diagnostics/api/contract`,localImplementationModule:`@coreframe/dashboard/plugins/diagnostics/api/local`,deployedImplementationModule:`@coreframe/dashboard/plugins/diagnostics/api/worker`});function r(){return n}export{r as diagnostics,n as diagnosticsPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createClient as e}from"../../../api/client.js";import t from"../api/contract.js";import{queryOptions as n}from"@tanstack/react-query";const r={overview:()=>n({queryKey:[`dashboard`,`plugins`,`diagnostics`,`overview`],queryFn:()=>e(t).queries.overview()})};export{r as diagnosticsQueries};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Button as e,EmptyState as t,ErrorState as n}from"../../web/ui/index.js";import{DashboardPage as r}from"../../web/dashboard/dashboard-page.js";import{DeployedDashboardPage as i}from"../../web/dashboard/deployed-dashboard-page.js";import a from"../../web/root.style.js";import{diagnosticsQueries as o}from"./web/queries.js";import{useQuery as s}from"@tanstack/react-query";import{jsx as c}from"react/jsx-runtime";function l(){let t=s(o.overview());return t.isPending?c(u,{title:`Loading dashboard`,message:`Reading the latest project diagnostics.`}):t.isError?c(u,{error:!0,title:`Dashboard unavailable`,message:t.error.message,action:c(e,{className:a.button,onClick:()=>void t.refetch(),children:`Retry`})}):t.data.mode===`deployed`?c(i,{payload:t.data,onRefresh:()=>void t.refetch()}):c(r,{payload:t.data,onRefresh:()=>void t.refetch()})}function u({title:e,message:r,action:i,error:o=!1}){return c(o?n:t,{action:i,className:a.statePage,message:r,title:e})}export{l as default};
|