@visulima/ono 1.0.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/CHANGELOG.md +5 -0
- package/LICENSE.md +27 -0
- package/README.md +617 -0
- package/dist/error-inspector/page/create-request-context.d.ts +45 -0
- package/dist/error-inspector/page/create-request-context.js +163 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +1327 -0
- package/dist/packem_shared/clipboard-XQlKTYnW.js +1 -0
- package/dist/packem_shared/process-B37didfB.js +1 -0
- package/dist/packem_shared/types-B8vYgwmD.d.ts +53 -0
- package/dist/server/open-in-editor.d.ts +18 -0
- package/dist/server/open-in-editor.js +3 -0
- package/package.json +181 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.defineProperty;var h=(t,e)=>g(t,"name",{value:e,configurable:!0});import p from"isomorphic-dompurify";var D=Object.defineProperty,r=h((t,e)=>D(t,"name",{value:e,configurable:!0}),"e$1");const v=["http://","https://","/","./","../"],d="#",w={'"':""","&":"&","'":"'","<":"<",">":">"},f=/^[\w+/-]+={0,2}$/,a=r(t=>String(t??"").trim(),"toString"),m=r(t=>t.replaceAll(/[&<>"']/g,e=>w[e]),"escapeHtml"),y=r(t=>{try{return p.sanitize(a(t))}catch{return m(a(t))}},"sanitizeHtml"),E=r(t=>{const e=a(t);if(!e)return"";try{return p.sanitize(e).replaceAll('"',""").replaceAll("'","'")}catch{return m(e)}},"sanitizeAttribute"),C=r(t=>{const e=a(t);if(!e)return d;try{const i=p.sanitize(e),s=i.toLowerCase();return v.some(n=>s.startsWith(n))?i:d}catch{return d}},"sanitizeUrlAttribute"),H=r(t=>{const e=a(t);if(!e)return"";try{return p.sanitize(e,{ADD_ATTR:["class","style"]})}catch{return y(e)}},"sanitizeCodeHtml"),z=r(t=>{const e=a(t);if(e)return f.test(e)?e:void 0},"sanitizeCspNonce"),A=r((t={})=>{if(!t||typeof t!="object")return{};try{return{...t,cspNonce:z(t.cspNonce),openInEditorUrl:t.openInEditorUrl?C(t.openInEditorUrl):void 0}}catch{return{...t,cspNonce:void 0,openInEditorUrl:void 0}}},"sanitizeOptions");var F=Object.defineProperty,o=h((t,e)=>F(t,"name",{value:e,configurable:!0}),"e");let c,l;const b=o(async()=>{try{const[t,e]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:i}=t,{createJavaScriptRegexEngine:s}=e,n=await i({themes:[import("@shikijs/themes/github-dark-default"),import("@shikijs/themes/github-light")],langs:[import("@shikijs/langs/javascript"),import("@shikijs/langs/typescript"),import("@shikijs/langs/jsx"),import("@shikijs/langs/tsx"),import("@shikijs/langs/json"),import("@shikijs/langs/jsonc"),import("@shikijs/langs/xml"),import("@shikijs/langs/sql"),import("@shikijs/langs/bash"),import("@shikijs/langs/shell"),import("@shikijs/langs/markdown"),import("@shikijs/langs/mdx")],engine:s()}),u=n;return l=o(()=>{try{n?.dispose?.()}catch{}c=void 0},"disposeFn"),u}catch{const{createHighlighter:t}=await import("shiki"),e=await t({langs:["javascript","typescript","jsx","tsx","json","jsonc","xml","sql","bash","shell","markdown","mdx"],themes:["github-dark-default","github-light"]});return l=o(()=>{try{e?.dispose?.()}catch{}c=void 0},"disposeFn"),e}},"createSingletonHighlighter"),j=o(async()=>(c||(c=b()),c),"getHighlighter");o(async()=>{try{l&&(l(),l=void 0)}catch{}},"disposeHighlighter");o((t=[])=>({name:"@shikijs/transformers:compact-line-options",line(e,i){const s=t.find(n=>n.line===i);return s?.classes&&this.addClassToHast(e,s.classes),e}}),"transformerCompactLineOptions");const U="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",N="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";export{E as a,z as b,j as c,C as d,U as e,A as f,H as g,N as n,y as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var s=(r,e)=>c(r,"name",{value:e,configurable:!0});var l=Object.defineProperty,i=s((r,e)=>l(r,"name",{value:e,configurable:!0}),"n");const f=globalThis.process||Object.create(null),n={versions:{}},a=new Proxy(f,{get(r,e){if(e in r)return r[e];if(e in n)return n[e]}});let o,t;const P=i(()=>(o===void 0&&(o=a.version||""),o),"getProcessVersion"),v=i(()=>(t===void 0&&(t=a.platform||""),t),"getProcessPlatform");export{v as a,P as g,a as t};
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
intellij = "IntelliJ IDEA",
|
|
15
|
+
idea = "IntelliJ IDEA",
|
|
16
|
+
nano = "GNU nano",
|
|
17
|
+
neovim = "NeoVim",
|
|
18
|
+
"notepad++" = "Notepad++",
|
|
19
|
+
phpstorm = "PhpStorm",
|
|
20
|
+
pycharm = "PyCharm",
|
|
21
|
+
rider = "Rider",
|
|
22
|
+
rubymine = "RubyMine",
|
|
23
|
+
sublime = "SublimeText",
|
|
24
|
+
textmate = "TextMate",
|
|
25
|
+
vim = "Vim",
|
|
26
|
+
visualstudio = "Visual Studio",
|
|
27
|
+
vscode = "Visual Studio Code",
|
|
28
|
+
vscodium = "VSCodium",
|
|
29
|
+
webstorm = "WebStorm",
|
|
30
|
+
xcode = "Xcode",
|
|
31
|
+
zed = "Zed"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type Theme = "dark" | "light" | "auto";
|
|
35
|
+
|
|
36
|
+
type ContentPage = {
|
|
37
|
+
code: {
|
|
38
|
+
html: string;
|
|
39
|
+
script?: string;
|
|
40
|
+
};
|
|
41
|
+
defaultSelected?: boolean;
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
};
|
|
45
|
+
type TemplateOptions = {
|
|
46
|
+
content?: ContentPage[];
|
|
47
|
+
cspNonce?: string;
|
|
48
|
+
editor?: Editors;
|
|
49
|
+
openInEditorUrl?: string;
|
|
50
|
+
theme?: Theme;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type { ContentPage as C, TemplateOptions as T };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
|
|
3
|
+
type RequestBody = Record<string, unknown>;
|
|
4
|
+
type UniversalHandler = (request: IncomingMessage & {
|
|
5
|
+
body?: RequestBody;
|
|
6
|
+
}, response: ServerResponse, next?: (error?: unknown) => void) => Promise<void>;
|
|
7
|
+
type NodeHttpHandler = (request: IncomingMessage & {
|
|
8
|
+
body?: RequestBody;
|
|
9
|
+
}, response: ServerResponse) => Promise<void>;
|
|
10
|
+
type OpenInEditorOptions = {
|
|
11
|
+
allowOutsideProject?: boolean;
|
|
12
|
+
projectRoot?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const createOpenInEditorMiddleware: (options?: OpenInEditorOptions) => UniversalHandler;
|
|
15
|
+
declare const createNodeHttpHandler: (options?: OpenInEditorOptions) => NodeHttpHandler;
|
|
16
|
+
declare const createExpressHandler: (options?: OpenInEditorOptions) => UniversalHandler;
|
|
17
|
+
|
|
18
|
+
export { type OpenInEditorOptions, createExpressHandler, createNodeHttpHandler, createOpenInEditorMiddleware };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var Kt=Object.defineProperty;var v=(t,n)=>Kt(t,"name",{value:n,configurable:!0});import{realpathSync as Te}from"node:fs";import le from"path";import Xt from"fs";import er from"os";import Ye from"child_process";import tr from"url";import{a as _e}from"../packem_shared/process-B37didfB.js";var rr=Object.defineProperty,ye=v((t,n)=>rr(t,"name",{value:n,configurable:!0}),"I"),nr=Object.defineProperty,h=ye((t,n)=>nr(t,"name",{value:n,configurable:!0}),"__name$2");let qe=h(()=>{var t=(()=>{var n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,p=h((e,r)=>{for(var a in r)n(e,a,{get:r[a],enumerable:!0})},"J"),d=h((e,r,a,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of i(r))!c.call(e,l)&&l!==a&&n(e,l,{get:h(()=>r[l],"get"),enumerable:!(u=s(r,l))||u.enumerable});return e},"T"),b=h(e=>d(n({},"__esModule",{value:!0}),e),"W"),B={};p(B,{zeptomatch:h(()=>Vt,"zeptomatch")});var f=h(e=>Array.isArray(e),"k"),o=h(e=>typeof e=="function","x"),g=h(e=>e.length===0,"K"),w=(()=>{const{toString:e}=Function.prototype,r=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return a=>(a.length===0||a.length===1)&&r.test(e.call(a))})(),C=h(e=>typeof e=="number","Y"),R=h(e=>typeof e=="object"&&e!==null,"rr"),P=h(e=>e instanceof RegExp,"er"),T=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return r=>e.test(r.source)})(),M=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return r=>e.test(r.source)&&!r.flags.includes("i")})(),I=h(e=>typeof e=="string","M"),x=h(e=>e===void 0,"f"),L=h(e=>{const r=new Map;return a=>{const u=r.get(a);if(u!==void 0)return u;const l=e(a);return r.set(a,l),l}},"ar"),E=h((e,r,a={})=>{const u={cache:{},input:e,index:0,indexBacktrackMax:0,options:a,output:[]},l=N(r)(u),S=Math.max(u.index,u.indexBacktrackMax);if(l&&u.index===e.length)return u.output;throw new Error(`Failed to parse at index ${S}`)},"or"),m=h((e,r)=>f(e)?z(e,r):I(e)?y(e,r):_(e,r),"o"),z=h((e,r)=>{const a={};for(const u of e){if(u.length!==1)throw new Error(`Invalid character: "${u}"`);const l=u.charCodeAt(0);a[l]=!0}return u=>{const l=u.input;let S=u.index,A=S;for(;A<l.length&&l.charCodeAt(A)in a;)A+=1;if(A>S){if(!x(r)&&!u.options.silent){const j=l.slice(S,A),G=o(r)?r(j,l,`${S}`):r;x(G)||u.output.push(G)}u.index=A}return!0}},"ir"),_=h((e,r)=>{if(M(e))return y(e.source,r);{const a=e.source,u=e.flags.replace(/y|$/,"y"),l=new RegExp(a,u);return T(e)&&o(r)&&!w(r)?D(l,r):W(l,r)}},"ur"),D=h((e,r)=>a=>{const u=a.index,l=a.input;e.lastIndex=u;const S=e.exec(l);if(S){const A=e.lastIndex;if(!a.options.silent){const j=r(...S,l,`${u}`);x(j)||a.output.push(j)}return a.index=A,!0}else return!1},"sr"),W=h((e,r)=>a=>{const u=a.index,l=a.input;if(e.lastIndex=u,e.test(l)){const S=e.lastIndex;if(!x(r)&&!a.options.silent){const A=o(r)?r(l.slice(u,S),l,`${u}`):r;x(A)||a.output.push(A)}return a.index=S,!0}else return!1},"cr"),y=h((e,r)=>a=>{const u=a.index,l=a.input;if(l.startsWith(e,u)){if(!x(r)&&!a.options.silent){const S=o(r)?r(e,l,`${u}`):r;x(S)||a.output.push(S)}return a.index+=e.length,!0}else return!1},"R"),V=h((e,r,a,u)=>{const l=N(e),S=r>1;return X($(K(A=>{let j=0;for(;j<a;){const G=A.index;if(!l(A)||(j+=1,A.index===G))break}return j>=r},S),u))},"O"),re=h((e,r)=>V(e,0,1,r),"lr"),q=h((e,r)=>V(e,0,1/0,r),"m"),H=h((e,r)=>{const a=e.map(N);return X($(K(u=>{for(let l=0,S=a.length;l<S;l++)if(!a[l](u))return!1;return!0}),r))},"_"),O=h((e,r)=>{const a=e.map(N);return X($(u=>{for(let l=0,S=a.length;l<S;l++)if(a[l](u))return!0;return!1},r))},"p"),K=h((e,r=!0,a=!1)=>{const u=N(e);return r?l=>{const S=l.index,A=l.output.length,j=u(l);return!j&&!a&&(l.indexBacktrackMax=Math.max(l.indexBacktrackMax,l.index)),(!j||a)&&(l.index=S,l.output.length!==A&&(l.output.length=A)),j}:u},"P"),$=h((e,r)=>{const a=N(e);return r?u=>{if(u.options.silent)return a(u);const l=u.output.length;if(a(u)){const S=u.output.splice(l,1/0),A=r(S);return x(A)||u.output.push(A),!0}else return!1}:a},"C"),X=(()=>{let e=0;return r=>{const a=N(r),u=e+=1;return l=>{var S;if(l.options.memoization===!1)return a(l);const A=l.index,j=(S=l.cache)[u]||(S[u]={indexMax:-1,queue:[]}),G=j.queue;if(A<=j.indexMax){const ne=j.store||(j.store=new Map);if(G.length){for(let te=0,Ht=G.length;te<Ht;te+=2){const Jt=G[te*2],Yt=G[te*2+1];ne.set(Jt,Yt)}G.length=0}const Q=ne.get(A);if(Q===!1)return!1;if(C(Q))return l.index=Q,!0;if(Q)return l.index=Q.index,Q.output?.length&&l.output.push(...Q.output),!0}const je=l.output.length,Zt=a(l);if(j.indexMax=Math.max(j.indexMax,A),Zt){const ne=l.index,Q=l.output.length;if(Q>je){const te=l.output.slice(je,Q);G.push(A,{index:ne,output:te})}else G.push(A,ne);return!0}else return G.push(A,!1),!1}}})(),F=h(e=>{let r;return a=>(r||(r=N(e())),r(a))},"A"),N=L(e=>{if(o(e))return g(e)?F(e):e;if(I(e)||P(e))return m(e);if(f(e))return H(e);if(R(e))return O(Object.values(e));throw new Error("Invalid rule")}),U=h(e=>e,"v"),ee=h(e=>r=>E(r,e,{memoization:!1}).join(""),"z"),tt=h(e=>{const r={};return a=>r[a]??(r[a]=e(a))},"pr"),Ce="abcdefghijklmnopqrstuvwxyz",rt=h(e=>{let r="";for(;e>0;){const a=(e-1)%26;r=Ce[a]+r,e=Math.floor((e-1)/26)}return r},"vr"),Se=h(e=>{let r=0;for(let a=0,u=e.length;a<u;a++)r=r*26+Ce.indexOf(e[a])+1;return r},"N"),ue=h((e,r)=>{if(r<e)return ue(r,e);const a=[];for(;e<=r;)a.push(e++);return a},"$"),nt=h((e,r,a)=>ue(e,r).map(u=>String(u).padStart(a,"0")),"fr"),Ae=h((e,r)=>ue(Se(e),Se(r)).map(rt),"j"),pe=m(/\\./,U),ot=m(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),it=m(/./,U),at=m(/^(?:!!)*!(.*)$/,(e,r)=>`(?!^${Ie(r)}$).*?`),st=m(/^(!!)+/,""),ct=O([at,st]),lt=m(/\/(\*\*\/)+/,"(?:[\\\\/].+[\\\\/]|[\\\\/])"),ut=m(/^(\*\*\/)+/,"(?:^|.*[\\\\/])"),pt=m(/\/(\*\*)$/,"(?:[\\\\/].*|$)"),mt=m(/\*\*/,".*"),$e=O([lt,ut,pt,mt]),dt=m(/\*\/(?!\*\*\/|\*$)/,"[^\\\\/]*[\\\\/]"),ft=m(/\*/,"[^\\\\/]*"),we=O([dt,ft]),Me=m("?","[^\\\\/]"),ht=m("[",U),xt=m("]",U),gt=m(/[!^]/,"^\\\\/"),bt=m(/[a-z]-[a-z]|[0-9]-[0-9]/i,U),vt=m(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Bt=m(/[^\]]/,U),Ot=O([pe,vt,bt,Bt]),Ee=H([ht,re(gt),q(Ot),xt]),yt=m("{","(?:"),Ct=m("}",")"),St=m(/(\d+)\.\.(\d+)/,(e,r,a)=>nt(+r,+a,Math.min(r.length,a.length)).join("|")),At=m(/([a-z]+)\.\.([a-z]+)/,(e,r,a)=>Ae(r,a).join("|")),$t=m(/([A-Z]+)\.\.([A-Z]+)/,(e,r,a)=>Ae(r.toLowerCase(),a.toLowerCase()).join("|").toUpperCase()),wt=O([St,At,$t]),Pe=H([yt,wt,Ct]),Mt=m("{","(?:"),Et=m("}",")"),Pt=m(",","|"),Rt=m(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),It=m(/[^}]/,U),jt=F(()=>Re),Tt=O([$e,we,Me,Ee,Pe,jt,pe,Rt,Pt,It]),Re=H([Mt,q(Tt),Et]),_t=q(O([ct,$e,we,Me,Ee,Pe,Re,pe,ot,it])),qt=_t,Lt=ee(qt),Ie=Lt,Nt=m(/\\./,U),kt=m(/./,U),zt=m(/\*\*\*+/,"*"),Dt=m(/([^/{[(!])\*\*/,(e,r)=>`${r}*`),Wt=m(/(^|.)\*\*(?=[^*/)\]}])/,(e,r)=>`${r}*`),Ut=q(O([Nt,zt,Dt,Wt,kt])),Gt=Ut,Ft=ee(Gt),Qt=Ft,oe=h((e,r)=>Array.isArray(e)?e.map(oe.compile).some(a=>a.test(r)):oe.compile(e).test(r),"S");oe.compile=tt(e=>new RegExp(`^${Ie(Qt(e))}[\\\\/]?$`,"s"));var Vt=oe;return b(B)})();return t.default||t},"_lazyMatch"),me;const or=h((t,n)=>(me||(me=qe(),qe=null),me(t,n)),"default");var ir=Object.defineProperty,ar=ye((t,n)=>ir(t,"name",{value:n,configurable:!0}),"__name$1");const sr=/^[A-Z]:\//i,Y=ar((t="")=>t&&t.replaceAll("\\","/").replace(sr,n=>n.toUpperCase()),"normalizeWindowsPath");var cr=Object.defineProperty,k=ye((t,n)=>cr(t,"name",{value:n,configurable:!0}),"__name");const lr=/^[/\\]{2}/,ur=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Ke=/^[A-Z]:$/i,Le=/^\/([A-Z]:)?$/i,pr=/.(\.[^./]+)$/,mr=/^[/\\]|^[a-z]:[/\\]/i,dr=k(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Ne="/",Xe=k((t,n)=>{let s="",i=0,c=-1,p=0,d=null;for(let b=0;b<=t.length;++b){if(b<t.length)d=t[b];else{if(d==="/")break;d="/"}if(d==="/"){if(!(c===b-1||p===1))if(p===2){if(s.length<2||i!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const B=s.lastIndexOf("/");B===-1?(s="",i=0):(s=s.slice(0,B),i=s.length-1-s.lastIndexOf("/")),c=b,p=0;continue}else if(s.length>0){s="",i=0,c=b,p=0;continue}}n&&(s+=s.length>0?"/..":"..",i=2)}else s.length>0?s+=`/${t.slice(c+1,b)}`:s=t.slice(c+1,b),i=b-c-1;c=b,p=0}else d==="."&&p!==-1?++p:p=-1}return s},"normalizeString"),J=k(t=>ur.test(t),"isAbsolute"),se=k(function(t){if(t.length===0)return".";t=Y(t);const n=lr.exec(t),s=J(t),i=t.at(-1)==="/";return t=Xe(t,!s),t.length===0?s?"/":i?"./":".":(i&&(t+="/"),Ke.test(t)&&(t+="/"),n?s?`//${t}`:`//./${t}`:s&&!J(t)?`/${t}`:t)},"normalize");k((...t)=>{let n="";for(const s of t)if(s)if(n.length>0){const i=n[n.length-1]==="/",c=s[0]==="/";i&&c?n+=s.slice(1):n+=i||c?s:`/${s}`}else n+=s;return se(n)},"join");const ce=k(function(...t){t=t.map(i=>Y(i));let n="",s=!1;for(let i=t.length-1;i>=-1&&!s;i--){const c=i>=0?t[i]:dr();!c||c.length===0||(n=`${c}/${n}`,s=J(c))}return n=Xe(n,!s),s&&!J(n)?`/${n}`:n.length>0?n:"."},"resolve");k(function(t){return Y(t)},"toNamespacedPath");const fr=k(function(t){return pr.exec(Y(t))?.[1]??""},"extname"),hr=k(function(t,n){const s=ce(t).replace(Le,"$1").split("/"),i=ce(n).replace(Le,"$1").split("/");if(i[0][1]===":"&&s[0][1]===":"&&s[0]!==i[0])return i.join("/");const c=[...s];for(const p of c){if(i[0]!==p)break;s.shift(),i.shift()}return[...s.map(()=>".."),...i].join("/")},"relative"),xr=k(t=>{const n=Y(t).replace(/\/$/,"").split("/").slice(0,-1);return n.length===1&&Ke.test(n[0])&&(n[0]+="/"),n.join("/")||(J(t)?"/":".")},"dirname");k(function(t){const n=[t.root,t.dir,t.base??t.name+t.ext].filter(Boolean);return Y(t.root?ce(...n):n.join("/"))},"format");const gr=k((t,n)=>{const s=Y(t).split("/").pop();return n&&s.endsWith(n)?s.slice(0,-n.length):s},"basename");k(function(t){const n=mr.exec(t)?.[0]?.replace(/\\/g,"/")??"",s=gr(t),i=fr(s);return{base:s,dir:xr(t),ext:i,name:s.slice(0,s.length-i.length),root:n}},"parse");k((t,n)=>or(n,se(t)),"matchesGlob");function br(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}v(br,"getDefaultExportFromCjs");var ie={exports:{}},ke;function vr(){if(ke)return ie.exports;ke=1;var t=Object.defineProperty,n=v((f,o)=>t(f,"name",{value:o,configurable:!0}),"t");let s=process||{},i=s.argv||[],c=s.env||{},p=!(c.NO_COLOR||i.includes("--no-color"))&&(!!c.FORCE_COLOR||i.includes("--color")||s.platform==="win32"||(s.stdout||{}).isTTY&&c.TERM!=="dumb"||!!c.CI),d=n((f,o,g=f)=>w=>{let C=""+w,R=C.indexOf(o,f.length);return~R?f+b(C,o,g,R)+o:f+C+o},"formatter"),b=n((f,o,g,w)=>{let C="",R=0;do C+=f.substring(R,w)+g,R=w+o.length,w=f.indexOf(o,R);while(~w);return C+f.substring(R)},"replaceClose"),B=n((f=p)=>{let o=f?d:()=>String;return{isColorSupported:f,reset:o("\x1B[0m","\x1B[0m"),bold:o("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:o("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:o("\x1B[3m","\x1B[23m"),underline:o("\x1B[4m","\x1B[24m"),inverse:o("\x1B[7m","\x1B[27m"),hidden:o("\x1B[8m","\x1B[28m"),strikethrough:o("\x1B[9m","\x1B[29m"),black:o("\x1B[30m","\x1B[39m"),red:o("\x1B[31m","\x1B[39m"),green:o("\x1B[32m","\x1B[39m"),yellow:o("\x1B[33m","\x1B[39m"),blue:o("\x1B[34m","\x1B[39m"),magenta:o("\x1B[35m","\x1B[39m"),cyan:o("\x1B[36m","\x1B[39m"),white:o("\x1B[37m","\x1B[39m"),gray:o("\x1B[90m","\x1B[39m"),bgBlack:o("\x1B[40m","\x1B[49m"),bgRed:o("\x1B[41m","\x1B[49m"),bgGreen:o("\x1B[42m","\x1B[49m"),bgYellow:o("\x1B[43m","\x1B[49m"),bgBlue:o("\x1B[44m","\x1B[49m"),bgMagenta:o("\x1B[45m","\x1B[49m"),bgCyan:o("\x1B[46m","\x1B[49m"),bgWhite:o("\x1B[47m","\x1B[49m"),blackBright:o("\x1B[90m","\x1B[39m"),redBright:o("\x1B[91m","\x1B[39m"),greenBright:o("\x1B[92m","\x1B[39m"),yellowBright:o("\x1B[93m","\x1B[39m"),blueBright:o("\x1B[94m","\x1B[39m"),magentaBright:o("\x1B[95m","\x1B[39m"),cyanBright:o("\x1B[96m","\x1B[39m"),whiteBright:o("\x1B[97m","\x1B[39m"),bgBlackBright:o("\x1B[100m","\x1B[49m"),bgRedBright:o("\x1B[101m","\x1B[49m"),bgGreenBright:o("\x1B[102m","\x1B[49m"),bgYellowBright:o("\x1B[103m","\x1B[49m"),bgBlueBright:o("\x1B[104m","\x1B[49m"),bgMagentaBright:o("\x1B[105m","\x1B[49m"),bgCyanBright:o("\x1B[106m","\x1B[49m"),bgWhiteBright:o("\x1B[107m","\x1B[49m")}},"createColors");return ie.exports=B(),ie.exports.createColors=B,ie.exports}v(vr,"requirePicocolors");var ae={},de,ze;function Br(){if(ze)return de;ze=1;var t=Object.defineProperty,n=v((s,i)=>t(s,"name",{value:i,configurable:!0}),"n");return de=n(function(s){return s.map(function(i){return i===""?"''":i&&typeof i=="object"?i.op.replace(/(.)/g,"\\$1"):/["\s\\]/.test(i)&&!/'/.test(i)?"'"+i.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(i)?'"'+i.replace(/(["\\$`!])/g,"\\$1")+'"':String(i).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")},"quote"),de}v(Br,"requireQuote");var fe,De;function Or(){if(De)return fe;De=1;for(var t=Object.defineProperty,n=v((I,x)=>t(I,"name",{value:x,configurable:!0}),"c"),s="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",i=new RegExp("^"+s+"$"),c="|&;()<> \\t",p='"((\\\\"|[^"])*?)"',d="'((\\\\'|[^'])*?)'",b=/^#$/,B="'",f='"',o="$",g="",w=4294967296,C=0;C<4;C++)g+=(w*Math.random()).toString(16);var R=new RegExp("^"+g);function P(I,x){for(var L=x.lastIndex,E=[],m;m=x.exec(I);)E.push(m),x.lastIndex===m.index&&(x.lastIndex+=1);return x.lastIndex=L,E}v(P,"matchAll"),n(P,"matchAll");function T(I,x,L){var E=typeof I=="function"?I(L):I[L];return typeof E>"u"&&L!=""?E="":typeof E>"u"&&(E="$"),typeof E=="object"?x+g+JSON.stringify(E)+g:x+E}v(T,"getVar"),n(T,"getVar");function M(I,x,L){L||(L={});var E=L.escape||"\\",m="(\\"+E+`['"`+c+`]|[^\\s'"`+c+"])+",z=new RegExp(["("+s+")","("+m+"|"+p+"|"+d+")+"].join("|"),"g"),_=P(I,z);if(_.length===0)return[];x||(x={});var D=!1;return _.map(function(W){var y=W[0];if(!y||D)return;if(i.test(y))return{op:y};var V=!1,re=!1,q="",H=!1,O;function K(){O+=1;var F,N,U=y.charAt(O);if(U==="{"){if(O+=1,y.charAt(O)==="}")throw new Error("Bad substitution: "+y.slice(O-2,O+1));if(F=y.indexOf("}",O),F<0)throw new Error("Bad substitution: "+y.slice(O));N=y.slice(O,F),O=F}else if(/[*@#?$!_-]/.test(U))N=U,O+=1;else{var ee=y.slice(O);F=ee.match(/[^\w\d_]/),F?(N=ee.slice(0,F.index),O+=F.index-1):(N=ee,O=y.length)}return T(x,"",N)}for(v(K,"R"),n(K,"parseEnvVar"),O=0;O<y.length;O++){var $=y.charAt(O);if(H=H||!V&&($==="*"||$==="?"),re)q+=$,re=!1;else if(V)$===V?V=!1:V==B?q+=$:$===E?(O+=1,$=y.charAt(O),$===f||$===E||$===o?q+=$:q+=E+$):$===o?q+=K():q+=$;else if($===f||$===B)V=$;else{if(i.test($))return{op:y};if(b.test($)){D=!0;var X={comment:I.slice(W.index+O+1)};return q.length?[q,X]:[X]}else $===E?re=!0:$===o?q+=K():q+=$}}return H?{op:"glob",pattern:q}:q}).reduce(function(W,y){return typeof y>"u"?W:W.concat(y)},[])}return v(M,"parseInternal"),n(M,"parseInternal"),fe=n(function(I,x,L){var E=M(I,x,L);return typeof x!="function"?E:E.reduce(function(m,z){if(typeof z=="object")return m.concat(z);var _=z.split(RegExp("("+g+".*?"+g+")","g"));return _.length===1?m.concat(_[0]):m.concat(_.filter(Boolean).map(function(D){return R.test(D)?JSON.parse(D.split(g)[1]):D}))},[])},"parse"),fe}v(Or,"requireParse");var We;function yr(){return We||(We=1,ae.quote=Br(),ae.parse=Or()),ae}v(yr,"requireShellQuote");var he,Ue;function Cr(){return Ue||(Ue=1,he={"/Applications/Atom.app/Contents/MacOS/Atom":"atom","/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta","/Applications/Brackets.app/Contents/MacOS/Brackets":"brackets","/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text.app/Contents/MacOS/sublime_text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/Cursor.app/Contents/MacOS/Cursor":"cursor","/Applications/Trae.app/Contents/MacOS/Electron":"trae","/Applications/AppCode.app/Contents/MacOS/appcode":"/Applications/AppCode.app/Contents/MacOS/appcode","/Applications/CLion.app/Contents/MacOS/clion":"/Applications/CLion.app/Contents/MacOS/clion","/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Applications/PhpStorm.app/Contents/MacOS/phpstorm":"/Applications/PhpStorm.app/Contents/MacOS/phpstorm","/Applications/PyCharm.app/Contents/MacOS/pycharm":"/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm":"/Applications/PyCharm CE.app/Contents/MacOS/pycharm","/Applications/RubyMine.app/Contents/MacOS/rubymine":"/Applications/RubyMine.app/Contents/MacOS/rubymine","/Applications/WebStorm.app/Contents/MacOS/webstorm":"/Applications/WebStorm.app/Contents/MacOS/webstorm","/Applications/MacVim.app/Contents/MacOS/MacVim":"mvim","/Applications/GoLand.app/Contents/MacOS/goland":"/Applications/GoLand.app/Contents/MacOS/goland","/Applications/Rider.app/Contents/MacOS/rider":"/Applications/Rider.app/Contents/MacOS/rider","/Applications/Zed.app/Contents/MacOS/zed":"zed"}),he}v(Cr,"requireMacos");var xe,Ge;function Sr(){return Ge||(Ge=1,xe={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",trae:"trae",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",webstorm:"webstorm","webstorm.sh":"webstorm",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider",zed:"zed"}),xe}v(Sr,"requireLinux");var ge,Fe;function Ar(){return Fe||(Fe=1,ge=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.exe","Cursor.exe","atom.exe","sublime_text.exe","notepad++.exe","clion.exe","clion64.exe","idea.exe","idea64.exe","phpstorm.exe","phpstorm64.exe","pycharm.exe","pycharm64.exe","rubymine.exe","rubymine64.exe","webstorm.exe","webstorm64.exe","goland.exe","goland64.exe","rider.exe","rider64.exe","trae.exe"]),ge}v(Ar,"requireWindows");var be,Qe;function $r(){if(Qe)return be;Qe=1;var t=Object.defineProperty,n=v((B,f)=>t(B,"name",{value:f,configurable:!0}),"u");const s=le,i=yr(),c=Ye,p=Cr(),d=Sr(),b=Ar();return be=n(function(B){if(B)return i.parse(B);if(process.env.LAUNCH_EDITOR)return[process.env.LAUNCH_EDITOR];if(process.versions.webcontainer)return[process.env.EDITOR||"code"];try{if(process.platform==="darwin"){const f=c.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString(),o=Object.keys(p),g=f.split(`
|
|
2
|
+
`);for(let w=0;w<o.length;w++){const C=o[w];if(g.includes(C))return[p[C]];const R=C.replace("/Applications","");if(f.indexOf(R)!==-1){if(C!==p[C])return[p[C]];const P=g.find(T=>T.endsWith(R));if(P!==void 0)return[P]}}}else if(process.platform==="win32"){const f=c.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString().split(`\r
|
|
3
|
+
`);for(let o=0;o<f.length;o++){const g=f[o].trim(),w=s.basename(g);if(b.indexOf(w)!==-1)return[g]}}else if(process.platform==="linux"){const f=c.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString(),o=Object.keys(d);for(let g=0;g<o.length;g++){const w=o[g];if(f.indexOf(w)!==-1)return[d[w]]}}}catch{}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]},"guessEditor"),be}v($r,"requireGuess");var ve,Ve;function wr(){if(Ve)return ve;Ve=1;var t=Object.defineProperty,n=v((i,c)=>t(i,"name",{value:c,configurable:!0}),"r");const s=le;return ve=n(function(i,c,p,d=1){switch(s.basename(i).replace(/\.(exe|cmd|bat)$/i,"")){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return[`${c}:${p}:${d}`];case"notepad++":return["-n"+p,"-c"+d,c];case"vim":case"mvim":return[`+call cursor(${p}, ${d})`,c];case"joe":case"gvim":return[`+${p}`,c];case"emacs":case"emacsclient":return[`+${p}:${d}`,c];case"rmate":case"mate":case"mine":return["--line",p,c];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"trae":case"cursor":case"vscodium":case"VSCodium":return["-r","-g",`${c}:${p}:${d}`];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return["--line",p,"--column",d,c]}return process.env.LAUNCH_EDITOR?[c,p,d]:[c]},"getArgumentsForPosition"),ve}v(wr,"requireGetArgs");var Be,Ze;function Mr(){if(Ze)return Be;Ze=1;var t=Object.defineProperty,n=v((P,T)=>t(P,"name",{value:T,configurable:!0}),"c");const s=Xt,i=er,c=le,p=vr(),d=Ye,b=$r(),B=wr();function f(P){return(T,M)=>{console.log(),console.log(p.red("Could not open "+c.basename(T)+" in the editor.")),M&&(M[M.length-1]!=="."&&(M+="."),console.log(p.red("The editor process exited with an error: "+M))),console.log(),P&&P(T,M)}}v(f,"wrapErrorCallback"),n(f,"wrapErrorCallback");function o(P){switch(P){case"vim":case"emacs":case"nano":return!0}return!1}v(o,"isTerminalEditor"),n(o,"isTerminalEditor");const g=/:(\d+)(:(\d+))?$/;function w(P){P.startsWith("file://")&&(P=tr.fileURLToPath(P));const T=P.replace(g,""),M=P.match(g),I=M&&M[1],x=M&&M[3];return{fileName:T,lineNumber:I,columnNumber:x}}v(w,"parseFile"),n(w,"parseFile");let C=null;function R(P,T,M){const I=w(P);let{fileName:x}=I;const{lineNumber:L,columnNumber:E}=I;if(!s.existsSync(x))return;typeof T=="function"&&(M=T,T=void 0),M=f(M);const[m,...z]=b(T);if(!m){M(x,null);return}if(process.platform==="linux"&&x.startsWith("/mnt/")&&/Microsoft/i.test(i.release())&&(x=c.relative("",x)),L){const _=B(m,x,L,E);z.push.apply(z,_)}else z.push(x);if(C&&o(m)&&C.kill("SIGKILL"),process.platform==="win32"){let _=v(function(y){return y.replace(/([&|<>,;=^])/g,"^$1")},"i"),D=v(function(y){return y.includes("^")?`^"${y}^"`:y.includes(" ")?`"${y}"`:y},"a");n(_,"escapeCmdArgs"),n(D,"doubleQuoteIfNeeded");const W=[m,...z.map(_)].map(D).join(" ");C=d.exec(W,{stdio:"inherit",shell:!0})}else C=d.spawn(m,z,{stdio:"inherit"});C.on("exit",function(_){C=null,_&&M(x,"(code "+_+")")}),C.on("error",function(_){let{code:D,message:W}=_;D==="ENOENT"&&(W=`${W} ('${m}' command does not exist in 'PATH')`),M(x,W)})}return v(R,"launchEditor"),n(R,"launchEditor"),Be=R,Be}v(Mr,"requireLaunchEditor");var Oe,He;function Er(){if(He)return Oe;He=1;var t=Object.defineProperty,n=v((c,p)=>t(c,"name",{value:p,configurable:!0}),"r");const s=le,i=Mr();return Oe=v((c,p,d)=>(typeof c=="function"&&(d=c,c=void 0),typeof p=="function"&&(d=p,p=void 0),p=p||process.cwd(),n(function(b,B){let f;try{const g=b.url.startsWith("http")?b.url:`http://localhost${b.url}`;f=new URL(g)}catch{B.statusCode=500,B.end("launch-editor-middleware: invalid URL.");return}const o=f.searchParams.get("file");if(!o)B.statusCode=500,B.end('launch-editor-middleware: required query param "file" is missing.');else{const g=o.startsWith("file://")?o:s.resolve(p,o);i(g,c,d),B.end()}},"launchEditorMiddleware")),"launchEditorMiddleware"),Oe}v(Er,"requireLaunchEditorMiddleware");var Pr=Er();const Rr=br(Pr);var Ir=Object.defineProperty,Z=v((t,n)=>Ir(t,"name",{value:n,configurable:!0}),"i");const Je=Z(t=>{if(typeof t.status=="function"){t.status(400).send("Failed to open editor");return}t.statusCode=400,t.end("Failed to open editor")},"respond400"),et=Z((t={})=>{const n=Z(async i=>{if(String(i.method||"GET").toUpperCase()==="POST")return i.body&&typeof i.body=="object"?i.body:new Promise(p=>{try{let d="";const b=Z(f=>{d+=String(f)},"onData"),B=Z(()=>{try{p(d?JSON.parse(d):{})}catch{p({})}},"onEnd");i.on("data",b),i.on("end",B),i.on("error",()=>p({}))}catch{p({})}});const c=new URL(i.url||"","http://localhost");return{column:Number(c.searchParams.get("column")||1),editor:c.searchParams.get("editor")||void 0,file:c.searchParams.get("file")||void 0,line:Number(c.searchParams.get("line")||1)}},"parseRequestBody"),s=Z((i,c,p)=>{if(!i)return;const d=J(i)?i:ce(c,i);if(!p)try{const b=Te(c),B=Te(d),f=se(b),o=se(B),g=_e()==="win32"||_e()==="darwin",w=g?f.toLowerCase():f,C=g?o.toLowerCase():o,R=hr(f,o);if(R.startsWith("..")||J(R)||g&&!C.startsWith(w))return}catch{const b=c.endsWith(Ne)?c:c+Ne;if(!d.startsWith(b))return}return d},"validateFilePath");return Z(async function(i,c,p){try{const d=await n(i),b=t.projectRoot??process.cwd(),B=s(d.file,b,t.allowOutsideProject??!1);if(!B){Je(c);return}const f=Rr(d.editor,b),o=new URLSearchParams({column:String(d.column??1),file:B,line:String(d.line??1)});if(d.editor&&o.set("editor",String(d.editor)),i.url=`/?${o.toString()}`,typeof p=="function"){f(i,c,p);return}await new Promise(g=>{f(i,c,()=>{g()})})}catch{Je(c)}},"universalHandler")},"createOpenInEditorMiddleware"),Dr=Z((t={})=>{const n=et(t);return async(s,i)=>n(s,i)},"createNodeHttpHandler"),Wr=Z((t={})=>et(t),"createExpressHandler");export{Wr as createExpressHandler,Dr as createNodeHttpHandler,et as createOpenInEditorMiddleware};
|
package/package.json
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@visulima/ono",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Ono is an error-parsing library that pretty prints JavaScript errors on a web page or the terminal.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"visulima",
|
|
7
|
+
"error",
|
|
8
|
+
"exception",
|
|
9
|
+
"error-inspector",
|
|
10
|
+
"diagnostics",
|
|
11
|
+
"debugging",
|
|
12
|
+
"stacktrace",
|
|
13
|
+
"code-frame",
|
|
14
|
+
"codeframe",
|
|
15
|
+
"source-code-preview",
|
|
16
|
+
"html-error",
|
|
17
|
+
"open-in-editor",
|
|
18
|
+
"cli",
|
|
19
|
+
"terminal",
|
|
20
|
+
"node",
|
|
21
|
+
"web",
|
|
22
|
+
"browser",
|
|
23
|
+
"express",
|
|
24
|
+
"connect",
|
|
25
|
+
"http-errors",
|
|
26
|
+
"devtools",
|
|
27
|
+
"error-reporting",
|
|
28
|
+
"whoops",
|
|
29
|
+
"youch",
|
|
30
|
+
"anolilab",
|
|
31
|
+
"webpack"
|
|
32
|
+
],
|
|
33
|
+
"homepage": "https://www.visulima.com/docs/package/ono",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/visulima/visulima.git",
|
|
37
|
+
"directory": "packages/ono"
|
|
38
|
+
},
|
|
39
|
+
"funding": [
|
|
40
|
+
{
|
|
41
|
+
"type": "github",
|
|
42
|
+
"url": "https://github.com/sponsors/prisis"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "consulting",
|
|
46
|
+
"url": "https://anolilab.com/support"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"author": {
|
|
51
|
+
"name": "Daniel Bannert",
|
|
52
|
+
"email": "d.bannert@anolilab.de"
|
|
53
|
+
},
|
|
54
|
+
"sideEffects": true,
|
|
55
|
+
"type": "module",
|
|
56
|
+
"exports": {
|
|
57
|
+
".": {
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"default": "./dist/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./page/context": {
|
|
62
|
+
"types": "./dist/error-inspector/page/create-request-context.d.ts",
|
|
63
|
+
"default": "./dist/error-inspector/page/create-request-context.js"
|
|
64
|
+
},
|
|
65
|
+
"./server/open-in-editor": {
|
|
66
|
+
"types": "./dist/server/open-in-editor.d.ts",
|
|
67
|
+
"default": "./dist/server/open-in-editor.js"
|
|
68
|
+
},
|
|
69
|
+
"./package.json": "./package.json"
|
|
70
|
+
},
|
|
71
|
+
"files": [
|
|
72
|
+
"dist",
|
|
73
|
+
"README.md",
|
|
74
|
+
"CHANGELOG.md",
|
|
75
|
+
"LICENSE.md"
|
|
76
|
+
],
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "packem build --development",
|
|
79
|
+
"build:prod": "packem build --production",
|
|
80
|
+
"clean": "rimraf node_modules dist .eslintcache",
|
|
81
|
+
"dev:hono": "packem build --development --watch --onSuccess 'node ./examples/hono/index.js'",
|
|
82
|
+
"dev:node": "packem build --development --watch --onSuccess 'node ./examples/node/index.js'",
|
|
83
|
+
"lint:attw": "attw --pack",
|
|
84
|
+
"lint:eslint": "eslint .",
|
|
85
|
+
"lint:eslint:fix": "eslint . --fix",
|
|
86
|
+
"lint:package-json": "publint --strict",
|
|
87
|
+
"lint:prettier": "prettier --config=.prettierrc.cjs --check .",
|
|
88
|
+
"lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
|
|
89
|
+
"lint:types": "tsc --noEmit",
|
|
90
|
+
"test": "vitest run",
|
|
91
|
+
"test:coverage": "vitest run --coverage",
|
|
92
|
+
"test:ui": "vitest --ui --coverage.enabled=true",
|
|
93
|
+
"test:watch": "vitest"
|
|
94
|
+
},
|
|
95
|
+
"dependencies": {
|
|
96
|
+
"@shikijs/langs": "^3.12.2",
|
|
97
|
+
"@shikijs/themes": "^3.12.2",
|
|
98
|
+
"@visulima/error": "4.5.0",
|
|
99
|
+
"isomorphic-dompurify": "^2.26.0",
|
|
100
|
+
"shiki": "^3.12.2"
|
|
101
|
+
},
|
|
102
|
+
"devDependencies": {
|
|
103
|
+
"@anolilab/eslint-config": "^16.3.0",
|
|
104
|
+
"@anolilab/prettier-config": "^6.0.4",
|
|
105
|
+
"@anolilab/semantic-release-preset": "^11.0.3",
|
|
106
|
+
"@arethetypeswrong/cli": "^0.18.1",
|
|
107
|
+
"@babel/core": "^7.28.4",
|
|
108
|
+
"@eslint/css": "0.11.0",
|
|
109
|
+
"@tailwindcss/forms": "^0.5.10",
|
|
110
|
+
"@tailwindcss/node": "^4.1.13",
|
|
111
|
+
"@tailwindcss/oxide": "^4.1.13",
|
|
112
|
+
"@tailwindcss/typography": "^0.5.16",
|
|
113
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
114
|
+
"@types/http-errors": "^2.0.5",
|
|
115
|
+
"@types/node": "24.3.1",
|
|
116
|
+
"@visulima/packem": "2.0.0-alpha.19",
|
|
117
|
+
"@visulima/path": "1.4.0",
|
|
118
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
119
|
+
"cross-env": "^10.0.0",
|
|
120
|
+
"cssnano": "7.1.1",
|
|
121
|
+
"esbuild": "0.25.9",
|
|
122
|
+
"eslint": "^9.35.0",
|
|
123
|
+
"http-errors": "^2.0.0",
|
|
124
|
+
"launch-editor-middleware": "2.11.1",
|
|
125
|
+
"lucide-static": "^0.544.0",
|
|
126
|
+
"marked": "^16.2.1",
|
|
127
|
+
"node-mocks-http": "^1.17.2",
|
|
128
|
+
"openai": "5.20.1",
|
|
129
|
+
"prettier": "^3.6.2",
|
|
130
|
+
"prettier-plugin-tailwindcss": "0.6.14",
|
|
131
|
+
"rimraf": "^6.0.1",
|
|
132
|
+
"semantic-release": "^24.2.8",
|
|
133
|
+
"sort-package-json": "^3.4.0",
|
|
134
|
+
"tailwind-csstree": "0.1.4",
|
|
135
|
+
"tailwindcss": "^4.1.13",
|
|
136
|
+
"typescript": "^5.9.2",
|
|
137
|
+
"vitest": "^3.2.4"
|
|
138
|
+
},
|
|
139
|
+
"peerDependencies": {
|
|
140
|
+
"@ai-sdk/anthropic": "^1.0.0",
|
|
141
|
+
"@ai-sdk/azure": "^1.0.0",
|
|
142
|
+
"@ai-sdk/google": "^1.0.0",
|
|
143
|
+
"@ai-sdk/mistral": "^1.0.0",
|
|
144
|
+
"@ai-sdk/ollama": "^1.0.0",
|
|
145
|
+
"@ai-sdk/openai": "^1.0.0",
|
|
146
|
+
"ai": "^4.0.0 || ^5.0.0"
|
|
147
|
+
},
|
|
148
|
+
"peerDependenciesMeta": {
|
|
149
|
+
"@ai-sdk/anthropic": {
|
|
150
|
+
"optional": true
|
|
151
|
+
},
|
|
152
|
+
"@ai-sdk/azure": {
|
|
153
|
+
"optional": true
|
|
154
|
+
},
|
|
155
|
+
"@ai-sdk/google": {
|
|
156
|
+
"optional": true
|
|
157
|
+
},
|
|
158
|
+
"@ai-sdk/mistral": {
|
|
159
|
+
"optional": true
|
|
160
|
+
},
|
|
161
|
+
"@ai-sdk/ollama": {
|
|
162
|
+
"optional": true
|
|
163
|
+
},
|
|
164
|
+
"@ai-sdk/openai": {
|
|
165
|
+
"optional": true
|
|
166
|
+
},
|
|
167
|
+
"ai": {
|
|
168
|
+
"optional": true
|
|
169
|
+
},
|
|
170
|
+
"open-editor": {
|
|
171
|
+
"optional": true
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"engines": {
|
|
175
|
+
"node": ">=20.19 <=24.*"
|
|
176
|
+
},
|
|
177
|
+
"publishConfig": {
|
|
178
|
+
"access": "public",
|
|
179
|
+
"provenance": true
|
|
180
|
+
}
|
|
181
|
+
}
|