@visulima/ono 2.0.0-alpha.9 → 2.0.1

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +270 -0
  2. package/README.md +44 -6
  3. package/dist/error-inspector/page/create-request-context.d.ts +41 -3
  4. package/dist/error-inspector/page/create-request-context.js +70 -70
  5. package/dist/index.d.ts +112 -18
  6. package/dist/index.js +224 -209
  7. package/dist/packem_shared/process-DVasYamT.js +1 -0
  8. package/dist/packem_shared/sanitize-D2LcyiFA.js +1 -0
  9. package/dist/packem_shared/types.d-D1UE67tt.d.ts +54 -0
  10. package/dist/server/open-in-editor.d.ts +22 -22
  11. package/dist/server/open-in-editor.js +1 -1
  12. package/package.json +44 -73
  13. package/dist/error-inspector/components/causes-viewer/index.d.ts +0 -7
  14. package/dist/error-inspector/components/copy-button.d.ts +0 -8
  15. package/dist/error-inspector/components/copy-dropdown.d.ts +0 -10
  16. package/dist/error-inspector/components/error-card/index.d.ts +0 -13
  17. package/dist/error-inspector/components/error-card/solutions.d.ts +0 -7
  18. package/dist/error-inspector/components/error-card/sticky-header.d.ts +0 -5
  19. package/dist/error-inspector/components/header-bar/editor-selector.d.ts +0 -3
  20. package/dist/error-inspector/components/header-bar/index.d.ts +0 -11
  21. package/dist/error-inspector/components/header-bar/theme-toggle.d.ts +0 -6
  22. package/dist/error-inspector/components/header-tabs.d.ts +0 -10
  23. package/dist/error-inspector/components/raw-stack-trace.d.ts +0 -2
  24. package/dist/error-inspector/components/shortcuts-button.d.ts +0 -5
  25. package/dist/error-inspector/components/stack-trace-viewer/index.d.ts +0 -7
  26. package/dist/error-inspector/components/stack-trace-viewer/types.d.ts +0 -5
  27. package/dist/error-inspector/components/stack-trace-viewer/utils/get-type.d.ts +0 -3
  28. package/dist/error-inspector/components/stack-trace-viewer/utils/group-similar-types.d.ts +0 -4
  29. package/dist/error-inspector/components/tooltip.d.ts +0 -4
  30. package/dist/error-inspector/index.d.ts +0 -6
  31. package/dist/error-inspector/layout.d.ts +0 -12
  32. package/dist/error-inspector/page/stack.d.ts +0 -15
  33. package/dist/error-inspector/page/types.d.ts +0 -62
  34. package/dist/error-inspector/types.d.ts +0 -43
  35. package/dist/error-inspector/utils/cn.d.ts +0 -2
  36. package/dist/error-inspector/utils/sanitize.d.ts +0 -7
  37. package/dist/packem_shared/clipboard-jWc8JBuB.js +0 -1
  38. package/dist/packem_shared/process-BO_aZsiL.js +0 -1
  39. package/dist/types.d.ts +0 -1
  40. package/dist/utils/process.d.ts +0 -7
  41. package/dist/utils/revision-hash.d.ts +0 -2
  42. package/dist/utils/runtimes.d.ts +0 -3
@@ -0,0 +1 @@
1
+ const c=globalThis.process||Object.create(null),r={versions:{}},s=new Proxy(c,{get(o,e){if(e in o)return o[e];if(e in r)return r[e]}});let t,n;const i=()=>(t??=s.version??"",t),a=()=>(n??=s.platform??"",n);export{a,s as e,i as g};
@@ -0,0 +1 @@
1
+ import{sanitize as n}from"isomorphic-dompurify";const l={javascript:()=>import("@shikijs/langs/javascript"),typescript:()=>import("@shikijs/langs/typescript"),jsx:()=>import("@shikijs/langs/jsx"),tsx:()=>import("@shikijs/langs/tsx"),json:()=>import("@shikijs/langs/json"),json5:()=>import("@shikijs/langs/json5"),jsonc:()=>import("@shikijs/langs/jsonc"),xml:()=>import("@shikijs/langs/xml"),sql:()=>import("@shikijs/langs/sql"),markdown:()=>import("@shikijs/langs/markdown"),mdx:()=>import("@shikijs/langs/mdx"),html:()=>import("@shikijs/langs/html"),css:()=>import("@shikijs/langs/css"),scss:()=>import("@shikijs/langs/scss"),less:()=>import("@shikijs/langs/less"),sass:()=>import("@shikijs/langs/sass"),stylus:()=>import("@shikijs/langs/stylus"),styl:()=>import("@shikijs/langs/styl"),svelte:()=>import("@shikijs/langs/svelte"),vue:()=>import("@shikijs/langs/vue"),bash:()=>import("@shikijs/langs/bash"),shell:()=>import("@shikijs/langs/shell"),yaml:()=>import("@shikijs/langs/yaml"),toml:()=>import("@shikijs/langs/toml"),python:()=>import("@shikijs/langs/python"),go:()=>import("@shikijs/langs/go"),rust:()=>import("@shikijs/langs/rust"),ruby:()=>import("@shikijs/langs/ruby"),php:()=>import("@shikijs/langs/php"),graphql:()=>import("@shikijs/langs/graphql"),dockerfile:()=>import("@shikijs/langs/dockerfile"),text:()=>Promise.resolve({name:"text",patterns:[],scopeName:"source.text",repository:{}})};let a;const m=async()=>{const[t,r]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:o}=t,{createJavaScriptRegexEngine:e}=r;return await o({themes:[import("../packem_chunks/min-dark.js"),import("../packem_chunks/min-light.js")],langs:[],engine:e()})},u=async(t,r)=>{if(r==="text")return;const o=r.toLowerCase();if(!(t.getLoadedLanguages?.()??t.getLanguages?.()??[]).includes(o)){const e=l[o];e&&await t.loadLanguage?.(await e())}},x=async(t=[])=>{a||(a=m());const r=await a,o=[];for(const e of t)if(typeof e=="string")o.push(e.toLowerCase());else{const s=e.name;s&&o.push(s.toLowerCase())}return await Promise.all(o.map(e=>u(r,e))),r},C="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-check%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M20%206%209%2017l-5-5%22%20%2F%3E%20%3C%2Fsvg%3E",A="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-clipboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Crect%20width%3D%228%22%20height%3D%224%22%20x%3D%228%22%20y%3D%222%22%20rx%3D%221%22%20ry%3D%221%22%20%2F%3E%20%3Cpath%20d%3D%22M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2%22%20%2F%3E%20%3C%2Fsvg%3E",h=["http://","https://","/","./","../"],p="#",g={'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;"},d=/^[\w+/-]+={0,2}$/,i=t=>{if(t==null)return"";if(typeof t=="string")return t.trim();if(typeof t=="object"||Array.isArray(t))try{return JSON.stringify(t).trim()}catch{return""}return String(t).trim()},c=t=>t.replaceAll(/[&<>"']/g,r=>g[r]),D=t=>{try{return n(i(t))}catch{return c(i(t))}},E=t=>{const r=i(t);if(!r)return"";try{return n(r).replaceAll('"',"&quot;").replaceAll("'","&#39;")}catch{return c(r)}},w=t=>{const r=i(t);if(!r)return p;try{const o=n(r),e=o.toLowerCase();return h.some(s=>e.startsWith(s))?o:p}catch{return p}},F=t=>{const r=i(t);if(!r)return"";try{return n(r,{ADD_ATTR:["class","style"]})}catch{return D(r)}},y=t=>{const r=i(t);if(r)return d.test(r)?r:void 0},k=(t={})=>{try{return{...t,cspNonce:y(t.cspNonce),openInEditorUrl:t.openInEditorUrl?w(t.openInEditorUrl):void 0}}catch{return{...t,cspNonce:void 0,openInEditorUrl:void 0}}};export{D as a,C as b,x as c,F as d,w as e,y as f,k as g,A as l,E as s};
@@ -0,0 +1,54 @@
1
+ declare enum Editors {
2
+ appcode = "AppCode",
3
+ "android-studio" = "Android Studio",
4
+ atom = "Atom",
5
+ "atom-beta" = "Atom Beta",
6
+ brackets = "Brackets",
7
+ clion = "CLion",
8
+ code = "Visual Studio Code",
9
+ "code-insiders" = "Visual Studio Code Insiders",
10
+ codium = "VSCodium",
11
+ cursor = "Cursor",
12
+ emacs = "GNU Emacs",
13
+ emacsforosx = "GNU Emacs for Mac OS X",
14
+ fleet = "JetBrains Fleet",
15
+ helix = "Helix",
16
+ intellij = "IntelliJ IDEA",
17
+ idea = "IntelliJ IDEA",
18
+ kiro = "Kiro",
19
+ nano = "GNU nano",
20
+ neovim = "NeoVim",
21
+ "notepad++" = "Notepad++",
22
+ phpstorm = "PhpStorm",
23
+ pycharm = "PyCharm",
24
+ rider = "Rider",
25
+ rubymine = "RubyMine",
26
+ sublime = "SublimeText",
27
+ textmate = "TextMate",
28
+ vim = "Vim",
29
+ visualstudio = "Visual Studio",
30
+ vscode = "Visual Studio Code",
31
+ vscodium = "VSCodium",
32
+ webstorm = "WebStorm",
33
+ windsurf = "Windsurf",
34
+ xcode = "Xcode",
35
+ zed = "Zed",
36
+ }
37
+ type Theme = "dark" | "light" | "auto";
38
+ type ContentPage = {
39
+ code: {
40
+ html: string;
41
+ script?: string;
42
+ };
43
+ defaultSelected?: boolean;
44
+ id: string;
45
+ name: string;
46
+ };
47
+ type TemplateOptions = {
48
+ content?: ContentPage[];
49
+ cspNonce?: string;
50
+ editor?: Editors;
51
+ openInEditorUrl?: string;
52
+ theme?: Theme;
53
+ };
54
+ export { ContentPage as C, TemplateOptions as T };
@@ -1,29 +1,29 @@
1
- import type { IncomingMessage, ServerResponse } from "node:http";
1
+ import { IncomingMessage, ServerResponse } from 'node:http';
2
2
  type RequestBody = Record<string, unknown>;
3
3
  type UniversalHandler = (request: IncomingMessage & {
4
- body?: RequestBody;
4
+ body?: RequestBody;
5
5
  }, response: ServerResponse, next?: (error?: unknown) => void) => Promise<void>;
6
6
  type NodeHttpHandler = (request: IncomingMessage & {
7
- body?: RequestBody;
7
+ body?: RequestBody;
8
8
  }, response: ServerResponse) => Promise<void>;
9
- export type OpenInEditorOptions = {
10
- allowOutsideProject?: boolean;
11
- projectRoot?: string;
9
+ type OpenInEditorOptions = {
10
+ allowOutsideProject?: boolean;
11
+ projectRoot?: string;
12
12
  };
13
13
  /**
14
- * Single universal handler factory for Node HTTP and Connect/Express.
15
- * Accepts POST JSON or GET query (?file&amp;line&amp;column&amp;editor).
16
- * Enforces projectRoot unless allowOutsideProject is true.
17
- * @example
18
- * ```typescript
19
- * const openInEditor = createOpenInEditorMiddleware({ projectRoot: process.cwd() })
20
- * // Node http
21
- * if (url.pathname === '/__open-in-editor') return openInEditor(req, res)
22
- * // Express/Connect
23
- * app.post('/__open-in-editor', openInEditor)
24
- * ```
25
- */
26
- export declare const createOpenInEditorMiddleware: (options?: OpenInEditorOptions) => UniversalHandler;
27
- export declare const createNodeHttpHandler: (options?: OpenInEditorOptions) => NodeHttpHandler;
28
- export declare const createExpressHandler: (options?: OpenInEditorOptions) => UniversalHandler;
29
- export {};
14
+ * Single universal handler factory for Node HTTP and Connect/Express.
15
+ * Accepts POST JSON or GET query (?file&amp;line&amp;column&amp;editor).
16
+ * Enforces projectRoot unless allowOutsideProject is true.
17
+ * @example
18
+ * ```typescript
19
+ * const openInEditor = createOpenInEditorMiddleware({ projectRoot: process.cwd() })
20
+ * // Node http
21
+ * if (url.pathname === '/__open-in-editor') return openInEditor(req, res)
22
+ * // Express/Connect
23
+ * app.post('/__open-in-editor', openInEditor)
24
+ * ```
25
+ */
26
+ declare const createOpenInEditorMiddleware: (options?: OpenInEditorOptions) => UniversalHandler;
27
+ declare const createNodeHttpHandler: (options?: OpenInEditorOptions) => NodeHttpHandler;
28
+ declare const createExpressHandler: (options?: OpenInEditorOptions) => UniversalHandler;
29
+ export { OpenInEditorOptions, createExpressHandler, createNodeHttpHandler, createOpenInEditorMiddleware };
@@ -1 +1 @@
1
- var Yt=Object.defineProperty;var T=(s,a)=>Yt(s,"name",{value:a,configurable:!0});import{createRequire as en}from"node:module";import rn from"launch-editor-middleware";import{a as be}from"../packem_shared/process-BO_aZsiL.js";const tn=en(import.meta.url),H=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nn=T(s=>{if(typeof H<"u"&&H.versions&&H.versions.node){const[a,i]=H.versions.node.split(".").map(Number);if(a>22||a===22&&i>=3||a===20&&i>=16)return H.getBuiltinModule(s)}return tn(s)},"__cjs_getBuiltinModule"),{realpathSync:we}=nn("node:fs");var on=Object.defineProperty,sn=T((s,a)=>on(s,"name",{value:a,configurable:!0}),"$e"),an=Object.defineProperty,te=sn((s,a)=>an(s,"name",{value:a,configurable:!0}),"W"),ln=Object.defineProperty,c=te((s,a)=>ln(s,"name",{value:a,configurable:!0}),"u$1");let ve=c(()=>{var s=(()=>{var a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,g=c((e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},"ne"),x=c((e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!d.call(e,r)&&r!==n&&a(e,r,{get:c(()=>t[r],"get"),enumerable:!(o=i(t,r))||o.enumerable});return e},"ae"),m=c(e=>x(a({},"__esModule",{value:!0}),e),"oe"),b={};g(b,{zeptomatch:c(()=>ye,"zeptomatch")});var v=c(e=>{const t=new Set,n=[e];for(let o=0;o<n.length;o++){const r=n[o];if(t.has(r))continue;t.add(r);const{children:l}=r;if(l?.length)for(let f=0,h=l.length;f<h;f++)n.push(l[f])}return Array.from(t)},"M"),O=c(e=>{let t="";const n=v(e);for(let o=0,r=n.length;o<r;o++){const l=n[o];if(!l.regex)continue;const f=l.regex.flags;if(t||(t=f),t!==f)throw new Error(`Inconsistent RegExp flags used: "${t}" and "${f}"`)}return t},"se"),_=c((e,t,n)=>{const o=n.get(e);if(o!==void 0)return o;const r=e.partial??t;let l="";if(e.regex&&(l+=r?"(?:$|":"",l+=e.regex.source),e.children?.length){const f=J(e.children.map(h=>_(h,t,n)).filter(Boolean));if(f?.length){const h=e.children.some(L=>!L.regex||!(L.partial??t)),y=f.length>1||r&&(!l.length||h);l+=y?r?"(?:$|":"(?:":"",l+=f.join("|"),l+=y?")":""}}return e.regex&&(l+=r?")":""),n.set(e,l),l},"O"),D=c((e,t)=>{const n=new Map,o=v(e);for(let r=o.length-1;r>=0;r--){const l=_(o[r],t,n);if(!(r>0))return l}return""},"ie"),J=c(e=>Array.from(new Set(e)),"ue"),I=c((e,t,n)=>I.compile(e,n).test(t),"R");I.compile=(e,t)=>{const n=t?.partial??!1,o=D(e,n),r=O(e);return new RegExp(`^(?:${o})$`,r)};var Ae=I,Ee=c((e,t)=>{const n=Ae.compile(e,t),o=`${n.source.slice(0,-1)}[\\\\/]?$`,r=n.flags;return new RegExp(o,r)},"le"),Re=Ee,ke=c(e=>{const t=e.map(o=>o.source).join("|")||"$^",n=e[0]?.flags;return new RegExp(t,n)},"ve"),Se=ke,ne=c(e=>Array.isArray(e),"j"),q=c(e=>typeof e=="function","_"),Ie=c(e=>e.length===0,"he"),Be=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return n=>(n.length===0||n.length===1)&&t.test(e.call(n))})(),We=c(e=>typeof e=="number","de"),Ce=c(e=>typeof e=="object"&&e!==null,"xe"),qe=c(e=>e instanceof RegExp,"me"),Ne=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),Le=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),re=c(e=>typeof e=="string","A"),z=c(e=>e===void 0,"f"),Ze=c(e=>{const t=new Map;return n=>{const o=t.get(n);if(o!==void 0)return o;const r=e(n);return t.set(n,r),r}},"ye"),oe=c((e,t,n={})=>{const o={cache:{},input:e,index:0,indexBacktrackMax:0,options:n,output:[]},r=A(t)(o),l=Math.max(o.index,o.indexBacktrackMax);if(r&&o.index===e.length)return o.output;throw new Error(`Failed to parse at index ${l}`)},"I"),p=c((e,t)=>ne(e)?He(e,t):re(e)?se(e,t):Fe(e,t),"i"),He=c((e,t)=>{const n={};for(const o of e){if(o.length!==1)throw new Error(`Invalid character: "${o}"`);const r=o.charCodeAt(0);n[r]=!0}return o=>{const r=o.input;let l=o.index,f=l;for(;f<r.length&&r.charCodeAt(f)in n;)f+=1;if(f>l){if(!z(t)&&!o.options.silent){const h=r.slice(l,f),y=q(t)?t(h,r,`${l}`):t;z(y)||o.output.push(y)}o.index=f}return!0}},"we"),Fe=c((e,t)=>{if(Le(e))return se(e.source,t);{const n=e.source,o=e.flags.replace(/y|$/,"y"),r=new RegExp(n,o);return Ne(e)&&q(t)&&!Be(t)?Te(r,t):Ue(r,t)}},"$e"),Te=c((e,t)=>n=>{const o=n.index,r=n.input;e.lastIndex=o;const l=e.exec(r);if(l){const f=e.lastIndex;if(!n.options.silent){const h=t(...l,r,`${o}`);z(h)||n.output.push(h)}return n.index=f,!0}else return!1},"Ee"),Ue=c((e,t)=>n=>{const o=n.index,r=n.input;if(e.lastIndex=o,e.test(r)){const l=e.lastIndex;if(!z(t)&&!n.options.silent){const f=q(t)?t(r.slice(o,l),r,`${o}`):t;z(f)||n.output.push(f)}return n.index=l,!0}else return!1},"Ce"),se=c((e,t)=>n=>{const o=n.index,r=n.input;if(r.startsWith(e,o)){if(!z(t)&&!n.options.silent){const l=q(t)?t(e,r,`${o}`):t;z(l)||n.output.push(l)}return n.index+=e.length,!0}else return!1},"F"),V=c((e,t,n,o)=>{const r=A(e),l=t>1;return Q(K(ie(f=>{let h=0;for(;h<n;){const y=f.index;if(!r(f)||(h+=1,f.index===y))break}return h>=t},l),o))},"k"),ae=c((e,t)=>V(e,0,1,t),"L"),F=c((e,t)=>V(e,0,1/0,t),"$"),Ge=c((e,t)=>V(e,1,1/0,t),"Re"),B=c((e,t)=>{const n=e.map(A);return Q(K(ie(o=>{for(let r=0,l=n.length;r<l;r++)if(!n[r](o))return!1;return!0}),t))},"x"),j=c((e,t)=>{const n=e.map(A);return Q(K(o=>{for(let r=0,l=n.length;r<l;r++)if(n[r](o))return!0;return!1},t))},"p"),ie=c((e,t=!0,n=!1)=>{const o=A(e);return t?r=>{const l=r.index,f=r.output.length,h=o(r);return!h&&!n&&(r.indexBacktrackMax=Math.max(r.indexBacktrackMax,r.index)),(!h||n)&&(r.index=l,r.output.length!==f&&(r.output.length=f)),h}:o},"q"),K=c((e,t)=>{const n=A(e);return t?o=>{if(o.options.silent)return n(o);const r=o.output.length;if(n(o)){const l=o.output.splice(r,1/0),f=t(l);return z(f)||o.output.push(f),!0}else return!1}:n},"B"),Q=(()=>{let e=0;return t=>{const n=A(t),o=e+=1;return r=>{var l;if(r.options.memoization===!1)return n(r);const f=r.index,h=(l=r.cache)[o]||(l[o]={indexMax:-1,queue:[]}),y=h.queue;if(f<=h.indexMax){const Z=h.store||(h.store=new Map);if(y.length){for(let C=0,Kt=y.length;C<Kt;C+=2){const Qt=y[C*2],Xt=y[C*2+1];Z.set(Qt,Xt)}y.length=0}const P=Z.get(f);if(P===!1)return!1;if(We(P))return r.index=P,!0;if(P)return r.index=P.index,P.output?.length&&r.output.push(...P.output),!0}const L=r.output.length,Vt=n(r);if(h.indexMax=Math.max(h.indexMax,f),Vt){const Z=r.index,P=r.output.length;if(P>L){const C=r.output.slice(L,P);y.push(f,{index:Z,output:C})}else y.push(f,Z);return!0}else return y.push(f,!1),!1}}})(),le=c(e=>{let t;return n=>(t||(t=A(e())),t(n))},"G"),A=Ze(e=>{if(q(e))return Ie(e)?le(e):e;if(re(e)||qe(e))return p(e);if(ne(e))return B(e);if(Ce(e))return j(Object.values(e));throw new Error("Invalid rule")}),R=c(e=>e,"d"),De=c(e=>typeof e=="string","ke"),Je=c(e=>{const t=new WeakMap,n=new WeakMap;return(o,r)=>{const l=r?.partial?n:t,f=l.get(o);if(f!==void 0)return f;const h=e(o,r);return l.set(o,h),h}},"Be"),Ve=c(e=>{const t={},n={};return(o,r)=>{const l=r?.partial?n:t;return l[o]??(l[o]=e(o,r))}},"Pe"),Ke=p(/\\./,R),Qe=p(/./,R),Xe=p(/\*\*\*+/,"*"),Ye=p(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),et=p(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),tt=F(j([Ke,Xe,Ye,et,Qe])),nt=tt,rt=c(e=>oe(e,nt,{memoization:!1}).join(""),"Ie"),ot=rt,ce="abcdefghijklmnopqrstuvwxyz",st=c(e=>{let t="";for(;e>0;){const n=(e-1)%26;t=ce[n]+t,e=Math.floor((e-1)/26)}return t},"Le"),ue=c(e=>{let t=0;for(let n=0,o=e.length;n<o;n++)t=t*26+ce.indexOf(e[n])+1;return t},"V"),X=c((e,t)=>{if(t<e)return X(t,e);const n=[];for(;e<=t;)n.push(e++);return n},"b"),at=c((e,t,n)=>X(e,t).map(o=>String(o).padStart(n,"0")),"qe"),fe=c((e,t)=>X(ue(e),ue(t)).map(st),"W"),$=c(e=>({partial:!1,regex:new RegExp(e,"s"),children:[]}),"c"),N=c(e=>({children:e}),"y"),W=(()=>{const e=c((t,n,o)=>{if(o.has(t))return;o.add(t);const{children:r}=t;if(!r.length)r.push(n);else for(let l=0,f=r.length;l<f;l++)e(r[l],n,o)},"e");return t=>{if(!t.length)return N([]);for(let n=t.length-1;n>=1;n--){const o=new Set,r=t[n-1],l=t[n];e(r,l,o)}return t[0]}})(),E=c(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),it=p(/\\./,$),lt=p(/[$.*+?^(){}[\]\|]/,e=>$(`\\${e}`)),ct=p(/[\\\/]/,E),ut=p(/[^$.*+?^(){}[\]\|\\\/]+/,$),ft=p(/^(?:!!)*!(.*)$/,(e,t)=>$(`(?!^${ye.compile(t).source}$).*?`)),pt=p(/^(!!)+/),dt=j([ft,pt]),ht=p(/\/(\*\*\/)+/,()=>N([W([E(),$(".+?"),E()]),E()])),gt=p(/^(\*\*\/)+/,()=>N([$("^"),W([$(".*?"),E()])])),xt=p(/\/(\*\*)$/,()=>N([W([E(),$(".*?")]),$("$")])),mt=p(/\*\*/,()=>$(".*?")),pe=j([ht,gt,xt,mt]),$t=p(/\*\/(?!\*\*\/|\*$)/,()=>W([$("[^\\\\/]*?"),E()])),yt=p(/\*/,()=>$("[^\\\\/]*")),de=j([$t,yt]),he=p("?",()=>$("[^\\\\/]")),wt=p("[",R),bt=p("]",R),vt=p(/[!^]/,"^\\\\/"),jt=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),Pt=p(/\\./,R),Mt=p(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Ot=p(/[\\\/]/,"\\\\/"),_t=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),zt=j([Pt,Mt,Ot,jt,_t]),ge=B([wt,ae(vt),F(zt),bt],e=>$(e.join(""))),At=p("{","(?:"),Et=p("}",")"),Rt=p(/(\d+)\.\.(\d+)/,(e,t,n)=>at(+t,+n,Math.min(t.length,n.length)).join("|")),kt=p(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>fe(t,n).join("|")),St=p(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>fe(t.toLowerCase(),n.toLowerCase()).join("|").toUpperCase()),It=j([Rt,kt,St]),xe=B([At,It,Et],e=>$(e.join(""))),Bt=p("{"),Wt=p("}"),Ct=p(","),qt=p(/\\./,$),Nt=p(/[$.*+?^(){[\]\|]/,e=>$(`\\${e}`)),Lt=p(/[\\\/]/,E),Zt=p(/[^$.*+?^(){}[\]\|\\\/,]+/,$),Ht=le(()=>$e),Ft=p("",()=>$("(?:)")),Tt=Ge(j([pe,de,he,ge,xe,Ht,qt,Nt,Lt,Zt]),W),me=j([Tt,Ft]),$e=B([Bt,ae(B([me,F(B([Ct,me]))])),Wt],N),Ut=F(j([dt,pe,de,he,ge,xe,$e,it,lt,ct,ut]),W),Gt=Ut,Dt=c(e=>oe(e,Gt,{memoization:!1})[0],"kr"),Jt=Dt,Y=c((e,t,n)=>Y.compile(e,n).test(t),"N");Y.compile=(()=>{const e=Ve((n,o)=>Re(Jt(ot(n)),o)),t=Je((n,o)=>Se(n.map(r=>e(r,o))));return(n,o)=>De(n)?e(n,o):t(n,o)})();var ye=Y;return m(b)})();return s.default||s},"_lazyMatch"),ee;const cn=c((s,a)=>(ee||(ee=ve(),ve=null),ee(s,a)),"default");var un=Object.defineProperty,fn=te((s,a)=>un(s,"name",{value:a,configurable:!0}),"t$1");const pn=/^[A-Z]:\//i,S=fn((s="")=>s&&s.replaceAll("\\","/").replace(pn,a=>a.toUpperCase()),"normalizeWindowsPath");var dn=Object.defineProperty,w=te((s,a)=>dn(s,"name",{value:a,configurable:!0}),"r");const hn=/^[/\\]{2}/,gn=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Oe=/^[A-Z]:$/i,je=/^\/([A-Z]:)?$/i,xn=/.(\.[^./]+)$/,mn=/^[/\\]|^[a-z]:[/\\]/i,$n=/\/$/,yn=w(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Pe="/",_e=w((s,a)=>{let i="",u=0,d=-1,g=0,x;for(let m=0;m<=s.length;++m){if(m<s.length)x=s[m];else{if(x==="/")break;x="/"}if(x==="/"){if(!(d===m-1||g===1))if(g===2){if(i.length<2||u!==2||!i.endsWith(".")||i.at(-2)!=="."){if(i.length>2){const b=i.lastIndexOf("/");b===-1?(i="",u=0):(i=i.slice(0,b),u=i.length-1-i.lastIndexOf("/")),d=m,g=0;continue}else if(i.length>0){i="",u=0,d=m,g=0;continue}}a&&(i+=i.length>0?"/..":"..",u=2)}else i.length>0?i+=`/${s.slice(d+1,m)}`:i=s.slice(d+1,m),u=m-d-1;d=m,g=0}else x==="."&&g!==-1?++g:g=-1}return i},"normalizeString"),k=w(s=>gn.test(s),"isAbsolute"),U=w(function(s){if(s.length===0)return".";s=S(s);const a=hn.exec(s),i=k(s),u=s.at(-1)==="/";return s=_e(s,!i),s.length===0?i?"/":u?"./":".":(u&&(s+="/"),Oe.test(s)&&(s+="/"),a?i?`//${s}`:`//./${s}`:i&&!k(s)?`/${s}`:s)},"normalize");w((...s)=>{let a="";for(const i of s)if(i)if(a.length>0){const u=a.at(-1)==="/",d=i[0]==="/";u&&d?a+=i.slice(1):a+=u||d?i:`/${i}`}else a+=i;return U(a)},"join");const G=w(function(...s){s=s.map(u=>S(u));let a="",i=!1;for(let u=s.length-1;u>=-1&&!i;u--){const d=u>=0?s[u]:yn();!d||d.length===0||(a=`${d}/${a}`,i=k(d))}return a=_e(a,!i),i&&!k(a)?`/${a}`:a.length>0?a:"."},"resolve");w(function(s){return S(s)},"toNamespacedPath");const wn=w(function(s){return xn.exec(S(s))?.[1]??""},"extname"),bn=w(function(s,a){const i=G(s).replace(je,"$1").split("/"),u=G(a).replace(je,"$1").split("/");if(u[0][1]===":"&&i[0][1]===":"&&i[0]!==u[0])return u.join("/");const d=[...i];for(const g of d){if(u[0]!==g)break;i.shift(),u.shift()}return[...i.map(()=>".."),...u].join("/")},"relative"),vn=w(s=>{const a=S(s).replace($n,"").split("/").slice(0,-1);return a.length===1&&Oe.test(a[0])&&(a[0]=`${a[0]}/`),a.join("/")||(k(s)?"/":".")},"dirname");w(function(s){const a=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return S(s.root?G(...a):a.join("/"))},"format");const jn=w((s,a)=>{const i=S(s).split("/").pop();return a&&i.endsWith(a)?i.slice(0,-a.length):i},"basename");w(function(s){const a=mn.exec(s)?.[0]?.replaceAll("\\","/")??"",i=jn(s),u=wn(i);return{base:i,dir:vn(s),ext:u,name:i.slice(0,i.length-u.length),root:a}},"parse");w((s,a)=>cn(a,U(s)),"matchesGlob");var Pn=Object.defineProperty,M=T((s,a)=>Pn(s,"name",{value:a,configurable:!0}),"a");const Me=M(s=>{if(typeof s.status=="function"){s.status(400).send("Failed to open editor");return}s.statusCode=400,s.end("Failed to open editor")},"respond400"),ze=M((s={})=>{const a=M(async u=>{if((u.method??"GET").toUpperCase()==="POST")return u.body&&typeof u.body=="object"?u.body:new Promise(g=>{try{let x="";const m=M(v=>{x+=String(v)},"onData"),b=M(()=>{try{g(x?JSON.parse(x):{})}catch{g({})}},"onEnd");u.on("data",m),u.on("end",b),u.on("error",()=>{g({})})}catch{g({})}});const d=new URL(u.url??"","http://localhost");return{column:Number(d.searchParams.get("column")??1),editor:d.searchParams.get("editor")??void 0,file:d.searchParams.get("file")??void 0,line:Number(d.searchParams.get("line")??1)}},"parseRequestBody"),i=M((u,d,g)=>{if(!u)return;const x=k(u)?u:G(d,u);if(!g)try{const m=we(d),b=we(x),v=U(m),O=U(b),_=be()==="win32"||be()==="darwin",D=_?v.toLowerCase():v,J=_?O.toLowerCase():O,I=bn(v,O);if(I.startsWith("..")||k(I)||_&&!J.startsWith(D))return}catch{const m=d.endsWith(Pe)?d:d+Pe;if(!x.startsWith(m))return}return x},"validateFilePath");return M(async function(u,d,g){try{const x=await a(u),m=s.projectRoot??process.cwd(),b=i(x.file,m,s.allowOutsideProject??!1);if(!b){Me(d);return}const v=rn(x.editor,m),O=new URLSearchParams({column:String(x.column??1),file:b,line:String(x.line??1)});if(x.editor&&O.set("editor",x.editor),u.url=`/?${O.toString()}`,typeof g=="function"){v(u,d,g);return}await new Promise(_=>{v(u,d,()=>{_()})})}catch{Me(d)}},"universalHandler")},"createOpenInEditorMiddleware"),An=M((s={})=>{const a=ze(s);return async(i,u)=>a(i,u)},"createNodeHttpHandler"),En=M((s={})=>ze(s),"createExpressHandler");export{En as createExpressHandler,An as createNodeHttpHandler,ze as createOpenInEditorMiddleware};
1
+ import{createRequire as S}from"node:module";import C from"launch-editor-middleware";import{a as $}from"../packem_shared/process-DVasYamT.js";const x=S(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[s,r]=h.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return h.getBuiltinModule(e)}return x(e)},{realpathSync:w}=O("node:fs"),N=/^[A-Z]:\//i,v=(e="")=>e&&e.replaceAll("\\","/").replace(N,s=>s.toUpperCase()),R=/^[/\\]{2}/,T=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,W=/^[A-Z]:$/i,P=/^\/([A-Z]:)?$/i,E=()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/",j=(e,s)=>{let r="",t=0,n=-1,o=0,c;for(let l=0;l<=e.length;++l){if(l<e.length)c=e[l];else{if(c==="/")break;c="/"}if(c==="/"){if(!(n===l-1||o===1))if(o===2){if(r.length<2||t!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const a=r.lastIndexOf("/");a===-1?(r="",t=0):(r=r.slice(0,a),t=r.length-1-r.lastIndexOf("/")),n=l,o=0;continue}else if(r.length>0){r="",t=0,n=l,o=0;continue}}s&&(r+=r.length>0?"/..":"..",t=2)}else r.length>0?r+=`/${e.slice(n+1,l)}`:r=e.slice(n+1,l),t=l-n-1;n=l,o=0}else c==="."&&o!==-1?++o:o=-1}return r},u=e=>T.test(e),p=function(e){if(e.length===0)return".";e=v(e);const s=R.exec(e),r=u(e),t=e.at(-1)==="/";return e=j(e,!r),e.length===0?r?"/":t?"./":".":(t&&(e+="/"),W.test(e)&&(e+="/"),s?r?`//${e}`:`//./${e}`:r&&!u(e)?`/${e}`:e)},g=function(...e){e=e.map(t=>v(t));let s="",r=!1;for(let t=e.length-1;t>=-1&&!r;t--){const n=t>=0?e[t]:E();!n||n.length===0||(s=`${n}/${s}`,r=u(n))}return s=j(s,!r),r&&!u(s)?`/${s}`:s.length>0?s:"."},b=function(e,s){const r=g(e).replace(P,"$1").split("/"),t=g(s).replace(P,"$1").split("/");if(t[0][1]===":"&&r[0][1]===":"&&r[0]!==t[0])return t.join("/");const n=Math.min(r.length,t.length);let o=0;for(;o<n&&r[o]===t[o];)o+=1;const c=r.length-o;return[...Array.from({length:c}).fill(".."),...t.slice(o)].join("/")},I=/^[\w.+-]+$/,_=e=>{if(typeof e.status=="function"){e.status(400).send("Failed to open editor");return}e.statusCode=400,e.end("Failed to open editor")},A=(e={})=>{const s=async t=>{if((t.method??"GET").toUpperCase()==="POST")return t.body&&typeof t.body=="object"?t.body:new Promise(o=>{try{let c="";const l=()=>{typeof t.removeListener=="function"&&(t.removeListener("data",a),t.removeListener("end",i),t.removeListener("error",f))},a=d=>{c+=String(d),c.length>1e6&&(l(),o({}))},i=()=>{l();try{o(c?JSON.parse(c):{})}catch{o({})}},f=()=>{l(),o({})};t.on("data",a),t.on("end",i),t.on("error",f)}catch{o({})}});const n=new URL(t.url??"","http://localhost");return{column:Number(n.searchParams.get("column")??1),editor:n.searchParams.get("editor")??void 0,file:n.searchParams.get("file")??void 0,line:Number(n.searchParams.get("line")??1)}},r=(t,n,o)=>{if(!t)return;const c=u(t)?t:g(n,t);if(!o)try{const l=w(n),a=w(c),i=p(l),f=p(a),d=$()==="win32"||$()==="darwin",m=d?i.toLowerCase():i,L=d?f.toLowerCase():f,y=b(i,f);if(y.startsWith("..")||u(y)||d&&!L.startsWith(m))return}catch{const l=b(p(n),p(c));if(l.startsWith("..")||u(l))return}return c};return async function(t,n,o){try{const c=await s(t),l=e.projectRoot??process.cwd(),a=r(c.file,l,e.allowOutsideProject??!1);if(!a){_(n);return}const i=c.editor&&I.test(c.editor)?c.editor:void 0,f=C(i,l),d=new URLSearchParams({column:String(c.column??1),file:a,line:String(c.line??1)});if(i&&d.set("editor",i),t.url=`/?${d.toString()}`,typeof o=="function"){f(t,n,o);return}await new Promise(m=>{f(t,n,()=>{m()})})}catch{_(n)}}},q=(e={})=>{const s=A(e);return async(r,t)=>s(r,t)},B=(e={})=>A(e);export{B as createExpressHandler,q as createNodeHttpHandler,A as createOpenInEditorMiddleware};
package/package.json CHANGED
@@ -1,36 +1,41 @@
1
1
  {
2
2
  "name": "@visulima/ono",
3
- "version": "2.0.0-alpha.9",
3
+ "version": "2.0.1",
4
4
  "description": "Ono is an error-parsing library that pretty prints JavaScript errors on a web page or the terminal.",
5
5
  "keywords": [
6
- "visulima",
7
- "error",
8
- "exception",
9
- "error-inspector",
10
- "diagnostics",
11
- "debugging",
12
- "stacktrace",
6
+ "anolilab",
7
+ "browser",
8
+ "cli",
13
9
  "code-frame",
14
10
  "codeframe",
15
- "source-code-preview",
11
+ "connect",
12
+ "debugging",
13
+ "devtools",
14
+ "diagnostics",
15
+ "error",
16
+ "error-inspector",
17
+ "error-reporting",
18
+ "exception",
19
+ "express",
16
20
  "html-error",
21
+ "http-errors",
22
+ "node",
17
23
  "open-in-editor",
18
- "cli",
24
+ "source-code-preview",
25
+ "stacktrace",
19
26
  "terminal",
20
- "node",
27
+ "visulima",
21
28
  "web",
22
- "browser",
23
- "express",
24
- "connect",
25
- "http-errors",
26
- "devtools",
27
- "error-reporting",
29
+ "webpack",
28
30
  "whoops",
29
- "youch",
30
- "anolilab",
31
- "webpack"
31
+ "youch"
32
32
  ],
33
33
  "homepage": "https://visulima.com/packages/ono/",
34
+ "license": "MIT",
35
+ "author": {
36
+ "name": "Daniel Bannert",
37
+ "email": "d.bannert@anolilab.de"
38
+ },
34
39
  "repository": {
35
40
  "type": "git",
36
41
  "url": "https://github.com/visulima/visulima.git",
@@ -46,13 +51,14 @@
46
51
  "url": "https://anolilab.com/support"
47
52
  }
48
53
  ],
49
- "license": "MIT",
50
- "author": {
51
- "name": "Daniel Bannert",
52
- "email": "d.bannert@anolilab.de"
53
- },
54
- "sideEffects": true,
54
+ "files": [
55
+ "dist",
56
+ "README.md",
57
+ "CHANGELOG.md",
58
+ "LICENSE.md"
59
+ ],
55
60
  "type": "module",
61
+ "sideEffects": true,
56
62
  "exports": {
57
63
  ".": {
58
64
  "types": "./dist/index.d.ts",
@@ -68,19 +74,20 @@
68
74
  },
69
75
  "./package.json": "./package.json"
70
76
  },
71
- "files": [
72
- "dist",
73
- "README.md",
74
- "CHANGELOG.md",
75
- "LICENSE.md"
76
- ],
77
+ "publishConfig": {
78
+ "access": "public",
79
+ "provenance": true
80
+ },
77
81
  "scripts": {
78
82
  "build": "packem build --development",
79
83
  "build:prod": "packem build --production",
80
84
  "clean": "rimraf node_modules dist .eslintcache",
81
85
  "dev:hono": "packem build --development --watch --onSuccess 'node ./examples/hono/index.js'",
82
86
  "dev:node": "packem build --development --watch --onSuccess 'node ./examples/node/index.js'",
83
- "lint:attw": "attw --pack",
87
+ "fallow:audit": "fallow audit",
88
+ "fallow:dead-code": "fallow dead-code",
89
+ "fallow:health": "fallow health --report-only",
90
+ "lint:attw": "attw --pack --profile esm-only",
84
91
  "lint:eslint": "eslint . --cache --concurrency auto",
85
92
  "lint:eslint:fix": "eslint . --cache --concurrency auto --fix",
86
93
  "lint:package-json": "publint --strict",
@@ -94,7 +101,7 @@
94
101
  },
95
102
  "dependencies": {
96
103
  "@shikijs/langs": "catalog:prod",
97
- "@visulima/error": "6.0.0-alpha.8",
104
+ "@visulima/error": "6.0.0",
98
105
  "isomorphic-dompurify": "catalog:prod",
99
106
  "launch-editor-middleware": "catalog:prod",
100
107
  "shiki": "catalog:syntax"
@@ -114,63 +121,27 @@
114
121
  "@types/http-errors": "catalog:types",
115
122
  "@types/node": "catalog:types",
116
123
  "@visulima/packem": "catalog:dev",
117
- "@visulima/path": "3.0.0-alpha.8",
124
+ "@visulima/path": "3.0.0",
118
125
  "@vitest/coverage-v8": "catalog:test",
119
126
  "cssnano": "catalog:dev",
120
127
  "esbuild": "catalog:build",
121
128
  "eslint": "catalog:lint",
129
+ "fallow": "catalog:lint",
122
130
  "http-errors": "catalog:dev",
123
131
  "lucide-static": "catalog:icons",
124
132
  "marked": "catalog:dev",
125
- "node-mocks-http": "catalog:dev",
126
133
  "openai": "catalog:dev",
127
134
  "prettier": "catalog:lint",
128
135
  "prettier-plugin-tailwindcss": "catalog:lint",
129
136
  "publint": "catalog:dev",
130
137
  "rimraf": "catalog:node",
131
138
  "semantic-release": "catalog:cli",
132
- "sort-package-json": "catalog:dev",
133
139
  "tailwind-csstree": "catalog:dev",
134
140
  "tailwindcss": "catalog:style",
135
141
  "typescript": "catalog:tsc",
136
142
  "vitest": "catalog:test"
137
143
  },
138
- "peerDependencies": {
139
- "@ai-sdk/anthropic": "catalog:peer",
140
- "@ai-sdk/azure": "catalog:peer",
141
- "@ai-sdk/google": "catalog:peer",
142
- "@ai-sdk/mistral": "catalog:peer",
143
- "@ai-sdk/openai": "catalog:peer",
144
- "ai": "^4.0.0 || ^5.0.0"
145
- },
146
- "peerDependenciesMeta": {
147
- "@ai-sdk/anthropic": {
148
- "optional": true
149
- },
150
- "@ai-sdk/azure": {
151
- "optional": true
152
- },
153
- "@ai-sdk/google": {
154
- "optional": true
155
- },
156
- "@ai-sdk/mistral": {
157
- "optional": true
158
- },
159
- "@ai-sdk/openai": {
160
- "optional": true
161
- },
162
- "ai": {
163
- "optional": true
164
- },
165
- "open-editor": {
166
- "optional": true
167
- }
168
- },
169
144
  "engines": {
170
- "node": ">=22.13 <=25.x"
171
- },
172
- "publishConfig": {
173
- "access": "public",
174
- "provenance": true
145
+ "node": "^22.14.0 || >=24.10.0"
175
146
  }
176
147
  }
@@ -1,7 +0,0 @@
1
- declare const causes: (causeList: unknown[], options?: {
2
- openInEditorUrl?: string;
3
- }) => Promise<{
4
- html: string;
5
- script: string;
6
- }>;
7
- export default causes;
@@ -1,8 +0,0 @@
1
- declare const copyButton: ({ label, successText, targetId }: {
2
- label?: string;
3
- successText?: string;
4
- targetId: string;
5
- }) => {
6
- html: string;
7
- };
8
- export default copyButton;
@@ -1,10 +0,0 @@
1
- declare const copyDropdown: ({ label, secondaryLabel, secondaryText, successText, targetId, }: {
2
- label?: string;
3
- secondaryLabel?: string;
4
- secondaryText: string;
5
- successText?: string;
6
- targetId: string;
7
- }) => {
8
- html: string;
9
- };
10
- export default copyDropdown;
@@ -1,13 +0,0 @@
1
- import type { VisulimaError } from "@visulima/error/error";
2
- import type { SolutionError, SolutionFinder } from "@visulima/error/solution";
3
- import type { RuntimeName } from "../../../utils/runtimes.d.ts";
4
- declare const errorCard: ({ error, runtimeName, solutionFinders, version, }: {
5
- error: Error | SolutionError | VisulimaError;
6
- runtimeName: RuntimeName | undefined;
7
- solutionFinders: SolutionFinder[];
8
- version: string | undefined;
9
- }) => Promise<{
10
- html: string;
11
- scripts: string[];
12
- }>;
13
- export default errorCard;
@@ -1,7 +0,0 @@
1
- import type { VisulimaError } from "@visulima/error/error";
2
- import type { SolutionError, SolutionFinder } from "@visulima/error/solution";
3
- declare const solutions: (error: Error | SolutionError | VisulimaError, solutionFinders?: SolutionFinder[]) => Promise<{
4
- html: string;
5
- script: string;
6
- }>;
7
- export default solutions;
@@ -1,5 +0,0 @@
1
- declare const stickyHeader: (error: Error) => Promise<{
2
- html: string;
3
- script: string;
4
- }>;
5
- export default stickyHeader;
@@ -1,3 +0,0 @@
1
- import Editors from "../../../../../../../shared/utils/editors.d.ts";
2
- declare const editorSelector: (editor?: Editors) => string;
3
- export default editorSelector;
@@ -1,11 +0,0 @@
1
- import type Editors from "../../../../../../../shared/utils/editors.d.ts";
2
- import type { Theme } from "../../../types.d.ts";
3
- declare const headerBar: (options: Partial<{
4
- editor: Editors;
5
- openInEditorUrl?: string;
6
- theme: Theme;
7
- }>, hasContextTab?: boolean) => {
8
- html: string;
9
- script: string;
10
- };
11
- export default headerBar;
@@ -1,6 +0,0 @@
1
- import type { Theme } from "../../../types.d.ts";
2
- declare const themeToggle: (theme?: Theme) => {
3
- html: string;
4
- script: string;
5
- };
6
- export default themeToggle;
@@ -1,10 +0,0 @@
1
- export type HeaderTab = {
2
- icon?: string;
3
- id: string;
4
- name: string;
5
- selected?: boolean;
6
- };
7
- export declare const headerTabs: (tabs: HeaderTab[]) => {
8
- html: string;
9
- script: string;
10
- };
@@ -1,2 +0,0 @@
1
- declare const rawStackTrace: (stack?: string) => string;
2
- export default rawStackTrace;
@@ -1,5 +0,0 @@
1
- declare const shortcutsButton: () => {
2
- html: string;
3
- script: string;
4
- };
5
- export default shortcutsButton;
@@ -1,7 +0,0 @@
1
- declare const stackTraceViewer: (error: Error, options?: {
2
- openInEditorUrl?: string;
3
- }) => Promise<{
4
- html: string;
5
- script: string;
6
- }>;
7
- export default stackTraceViewer;
@@ -1,5 +0,0 @@
1
- export type GroupType = "internal" | "node_modules" | "webpack" | "native" | "bun" | undefined;
2
- export type Item = {
3
- html: string;
4
- type: GroupType;
5
- };
@@ -1,3 +0,0 @@
1
- import type { GroupType } from "../types.d.ts";
2
- declare const getType: (filePath: string) => GroupType;
3
- export default getType;
@@ -1,4 +0,0 @@
1
- import type { Item } from "../types.d.ts";
2
- type Grouped = Item | Item[];
3
- declare const groupSimilarTypes: (list: Item[]) => Grouped[];
4
- export default groupSimilarTypes;
@@ -1,4 +0,0 @@
1
- declare const tooltip: ({ message }?: {
2
- message?: string;
3
- }) => string;
4
- export default tooltip;
@@ -1,6 +0,0 @@
1
- import type { VisulimaError } from "@visulima/error/error";
2
- import type { SolutionError, SolutionFinder } from "@visulima/error/solution";
3
- import type { TemplateOptions } from "./types.d.ts";
4
- type ErrorType = Error | SolutionError | VisulimaError;
5
- declare const template: (error: ErrorType, solutionFinders?: SolutionFinder[], options?: TemplateOptions) => Promise<string>;
6
- export default template;
@@ -1,12 +0,0 @@
1
- import type { Theme } from "../types.d.ts";
2
- declare const layout: ({ content, cspNonce, css, description, error, scripts, theme, title, }: {
3
- content: string;
4
- cspNonce?: string;
5
- css: string;
6
- description: string;
7
- error: Error;
8
- scripts: string[];
9
- theme?: Theme;
10
- title: string;
11
- }) => string;
12
- export default layout;
@@ -1,15 +0,0 @@
1
- import type { VisulimaError } from "@visulima/error/error";
2
- import type { SolutionError, SolutionFinder } from "@visulima/error/solution";
3
- import type { ContentPage, TemplateOptions } from "../types.d.ts";
4
- type ErrorType = Error | SolutionError | VisulimaError;
5
- /**
6
- * Generates the stack page content for the error inspector
7
- * This page displays error details, stack traces, and related causes
8
- * @param error The main error to display
9
- * @param solutionFinders Array of solution finder functions
10
- * @param options Template options including sanitization settings
11
- * @returns Promise resolving to content page data
12
- * @throws TypeError if input validation fails
13
- */
14
- declare const stack: (error: ErrorType, solutionFinders?: SolutionFinder[], options?: TemplateOptions) => Promise<ContentPage>;
15
- export default stack;
@@ -1,62 +0,0 @@
1
- import type { IncomingMessage } from "node:http";
2
- type NativeRequest = typeof globalThis.Request;
3
- type NativeHeaders = typeof globalThis.Headers;
4
- interface CustomHeaders {
5
- entries: () => IterableIterator<[string, string]>;
6
- forEach: (callback: (value: string, key: string) => void) => void;
7
- get: (name: string) => string | null;
8
- }
9
- interface CustomRequest {
10
- clone?: () => CustomRequest;
11
- headers?: Record<string, string | string[]> | CustomHeaders;
12
- json?: () => Promise<unknown>;
13
- method?: string;
14
- text?: () => Promise<string>;
15
- url?: string;
16
- }
17
- type HeadersLike = NativeHeaders | CustomHeaders;
18
- type RequestLikeType = NativeRequest | CustomRequest;
19
- type RequestLike = NativeRequest | (IncomingMessage & {
20
- body?: unknown;
21
- clone?: () => RequestLike;
22
- json?: () => Promise<unknown>;
23
- text?: () => Promise<string>;
24
- }) | CustomRequest | {
25
- body?: unknown;
26
- headers?: Record<string, string | string[]> | HeadersLike;
27
- method?: string;
28
- off?: (event: string, handler: (chunk: unknown) => void) => void;
29
- on?: (event: string, handler: (chunk: unknown) => void) => void;
30
- setEncoding?: (encoding: string) => void;
31
- url?: string;
32
- };
33
- type ExpressRequest = {
34
- body?: unknown;
35
- headers?: Record<string, string | string[]> | HeadersLike;
36
- method?: string;
37
- url?: string;
38
- };
39
- export declare const isNativeRequest: (request: RequestLike) => request is NativeRequest;
40
- export declare const isIncomingMessage: (request: RequestLike) => request is IncomingMessage;
41
- export declare const isExpressRequest: (request: RequestLike) => request is ExpressRequest;
42
- export declare const isHeadersObject: (object: unknown) => object is HeadersLike;
43
- export type HeaderValue = string | string[] | undefined;
44
- export type HeadersRecord = Record<string, HeaderValue>;
45
- export type HeadersInput = HeadersRecord | HeadersLike | undefined;
46
- export type HeadersOutput = Record<string, string | string[]> | undefined;
47
- export type ContextContentOptions = {
48
- context?: Record<string, unknown>;
49
- headerAllowlist?: string[];
50
- headerDenylist?: string[];
51
- maskValue?: string;
52
- previewBytes?: number;
53
- totalCapBytes?: number;
54
- };
55
- export type { HeadersLike, RequestLike, RequestLikeType };
56
- export declare const runtime: {
57
- hasNativeHeaders: boolean;
58
- hasNativeRequest: boolean;
59
- isBun: boolean;
60
- isDeno: boolean;
61
- isNodeJS: string | false;
62
- };