@visulima/ono 2.0.0-alpha.3 → 2.0.0-alpha.31

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 (46) hide show
  1. package/CHANGELOG.md +233 -0
  2. package/LICENSE.md +1 -1
  3. package/dist/error-inspector/page/create-request-context.d.ts +41 -3
  4. package/dist/error-inspector/page/create-request-context.js +48 -48
  5. package/dist/index.d.ts +34 -18
  6. package/dist/index.js +238 -186
  7. package/dist/packem_chunks/min-dark.js +1 -0
  8. package/dist/packem_chunks/min-light.js +1 -0
  9. package/dist/packem_shared/clipboard-DbMCKslu.js +1 -0
  10. package/dist/packem_shared/process-BO_aZsiL.js +1 -0
  11. package/dist/packem_shared/types.d-CDlBu_Vx.d.ts +50 -0
  12. package/dist/server/open-in-editor.d.ts +22 -22
  13. package/dist/server/open-in-editor.js +1 -1
  14. package/package.json +70 -70
  15. package/dist/error-inspector/components/causes-viewer/index.d.ts +0 -7
  16. package/dist/error-inspector/components/copy-button.d.ts +0 -8
  17. package/dist/error-inspector/components/copy-dropdown.d.ts +0 -10
  18. package/dist/error-inspector/components/error-card/index.d.ts +0 -13
  19. package/dist/error-inspector/components/error-card/solutions.d.ts +0 -7
  20. package/dist/error-inspector/components/error-card/sticky-header.d.ts +0 -5
  21. package/dist/error-inspector/components/header-bar/editor-selector.d.ts +0 -3
  22. package/dist/error-inspector/components/header-bar/index.d.ts +0 -11
  23. package/dist/error-inspector/components/header-bar/theme-toggle.d.ts +0 -6
  24. package/dist/error-inspector/components/header-tabs.d.ts +0 -10
  25. package/dist/error-inspector/components/raw-stack-trace.d.ts +0 -2
  26. package/dist/error-inspector/components/shortcuts-button.d.ts +0 -5
  27. package/dist/error-inspector/components/stack-trace-viewer/index.d.ts +0 -7
  28. package/dist/error-inspector/components/stack-trace-viewer/types.d.ts +0 -5
  29. package/dist/error-inspector/components/stack-trace-viewer/utils/get-type.d.ts +0 -3
  30. package/dist/error-inspector/components/stack-trace-viewer/utils/group-similar-types.d.ts +0 -4
  31. package/dist/error-inspector/components/tooltip.d.ts +0 -4
  32. package/dist/error-inspector/index.d.ts +0 -6
  33. package/dist/error-inspector/layout.d.ts +0 -12
  34. package/dist/error-inspector/page/stack.d.ts +0 -15
  35. package/dist/error-inspector/page/types.d.ts +0 -62
  36. package/dist/error-inspector/types.d.ts +0 -43
  37. package/dist/error-inspector/utils/cn.d.ts +0 -2
  38. package/dist/error-inspector/utils/sanitize.d.ts +0 -7
  39. package/dist/packem_chunks/github-dark-default.js +0 -1
  40. package/dist/packem_chunks/github-light.js +0 -1
  41. package/dist/packem_shared/clipboard-BS03XwiW.js +0 -1
  42. package/dist/packem_shared/process-B37didfB.js +0 -1
  43. package/dist/types.d.ts +0 -1
  44. package/dist/utils/process.d.ts +0 -7
  45. package/dist/utils/revision-hash.d.ts +0 -2
  46. package/dist/utils/runtimes.d.ts +0 -3
@@ -0,0 +1 @@
1
+ const e=Object.freeze(JSON.parse('{"colors":{"activityBar.background":"#1A1A1A","activityBar.foreground":"#7D7D7D","activityBarBadge.background":"#383838","badge.background":"#383838","badge.foreground":"#C1C1C1","button.background":"#333","debugIcon.breakpointCurrentStackframeForeground":"#79b8ff","debugIcon.breakpointDisabledForeground":"#848484","debugIcon.breakpointForeground":"#FF7A84","debugIcon.breakpointStackframeForeground":"#79b8ff","debugIcon.breakpointUnverifiedForeground":"#848484","debugIcon.continueForeground":"#FF7A84","debugIcon.disconnectForeground":"#FF7A84","debugIcon.pauseForeground":"#FF7A84","debugIcon.restartForeground":"#79b8ff","debugIcon.startForeground":"#79b8ff","debugIcon.stepBackForeground":"#FF7A84","debugIcon.stepIntoForeground":"#FF7A84","debugIcon.stepOutForeground":"#FF7A84","debugIcon.stepOverForeground":"#FF7A84","debugIcon.stopForeground":"#79b8ff","diffEditor.insertedTextBackground":"#3a632a4b","diffEditor.removedTextBackground":"#88063852","editor.background":"#1f1f1f","editor.lineHighlightBorder":"#303030","editorGroupHeader.tabsBackground":"#1A1A1A","editorGroupHeader.tabsBorder":"#1A1A1A","editorIndentGuide.activeBackground":"#383838","editorIndentGuide.background":"#2A2A2A","editorLineNumber.foreground":"#727272","editorRuler.foreground":"#2A2A2A","editorSuggestWidget.background":"#1A1A1A","focusBorder":"#444","foreground":"#888888","gitDecoration.ignoredResourceForeground":"#444444","input.background":"#2A2A2A","input.foreground":"#E0E0E0","inputOption.activeBackground":"#3a3a3a","list.activeSelectionBackground":"#212121","list.activeSelectionForeground":"#F5F5F5","list.focusBackground":"#292929","list.highlightForeground":"#EAEAEA","list.hoverBackground":"#262626","list.hoverForeground":"#9E9E9E","list.inactiveSelectionBackground":"#212121","list.inactiveSelectionForeground":"#F5F5F5","panelTitle.activeBorder":"#1f1f1f","panelTitle.activeForeground":"#FAFAFA","panelTitle.inactiveForeground":"#484848","peekView.border":"#444","peekViewEditor.background":"#242424","pickerGroup.border":"#363636","pickerGroup.foreground":"#EAEAEA","progressBar.background":"#FAFAFA","scrollbar.shadow":"#1f1f1f","sideBar.background":"#1A1A1A","sideBarSectionHeader.background":"#202020","statusBar.background":"#1A1A1A","statusBar.debuggingBackground":"#1A1A1A","statusBar.foreground":"#7E7E7E","statusBar.noFolderBackground":"#1A1A1A","statusBarItem.prominentBackground":"#fafafa1a","statusBarItem.remoteBackground":"#1a1a1a00","statusBarItem.remoteForeground":"#7E7E7E","symbolIcon.classForeground":"#FF9800","symbolIcon.constructorForeground":"#b392f0","symbolIcon.enumeratorForeground":"#FF9800","symbolIcon.enumeratorMemberForeground":"#79b8ff","symbolIcon.eventForeground":"#FF9800","symbolIcon.fieldForeground":"#79b8ff","symbolIcon.functionForeground":"#b392f0","symbolIcon.interfaceForeground":"#79b8ff","symbolIcon.methodForeground":"#b392f0","symbolIcon.variableForeground":"#79b8ff","tab.activeBorder":"#1e1e1e","tab.activeForeground":"#FAFAFA","tab.border":"#1A1A1A","tab.inactiveBackground":"#1A1A1A","tab.inactiveForeground":"#727272","terminal.ansiBrightBlack":"#5c5c5c","textLink.activeForeground":"#fafafa","textLink.foreground":"#CCC","titleBar.activeBackground":"#1A1A1A","titleBar.border":"#00000000"},"displayName":"Min Dark","name":"min-dark","semanticHighlighting":true,"tokenColors":[{"settings":{"foreground":"#b392f0"}},{"scope":["support.function","keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],"settings":{"foreground":"#b392f0"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":["strong","markup.heading.markdown","markup.bold.markdown"],"settings":{"fontStyle":"bold","foreground":"#FF7A84"}},{"scope":["markup.italic.markdown"],"settings":{"fontStyle":"italic"}},{"scope":"meta.link.inline.markdown","settings":{"fontStyle":"underline","foreground":"#1976D2"}},{"scope":["string","markup.fenced_code","markup.inline"],"settings":{"foreground":"#9db1c5"}},{"scope":["comment","string.quoted.docstring.multi"],"settings":{"foreground":"#6b737c"}},{"scope":["constant.language","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","support","string.other.link.title.markdown"],"settings":{"foreground":"#79b8ff"}},{"scope":["constant.numeric","constant.other.placeholder","constant.character.format.placeholder","meta.property-value","keyword.other.unit","keyword.other.template","entity.name.tag.yaml","entity.other.attribute-name","support.type.property-name.json"],"settings":{"foreground":"#f8f8f8"}},{"scope":["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","support.function.node","punctuation.separator.key-value","punctuation.definition.template-expression"],"settings":{"foreground":"#f97583"}},{"scope":"variable.parameter.function","settings":{"foreground":"#FF9800"}},{"scope":["entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],"settings":{"foreground":"#b392f0"}},{"scope":["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],"settings":{"foreground":"#ffab70"}},{"scope":"token.info-token","settings":{"foreground":"#316bcd"}},{"scope":"token.warn-token","settings":{"foreground":"#cd9731"}},{"scope":"token.error-token","settings":{"foreground":"#cd3131"}},{"scope":"token.debug-token","settings":{"foreground":"#800080"}},{"scope":["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],"settings":{"foreground":"#bbbbbb"}},{"scope":"markup.underline.link","settings":{"foreground":"#ffab70"}},{"scope":["beginning.punctuation.definition.list.markdown"],"settings":{"foreground":"#FF7A84"}},{"scope":"punctuation.definition.metadata.markdown","settings":{"foreground":"#ffab70"}},{"scope":["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown"],"settings":{"foreground":"#79b8ff"}}],"type":"dark"}'));export{e as default};
@@ -0,0 +1 @@
1
+ const e=Object.freeze(JSON.parse('{"colors":{"activityBar.background":"#f6f6f6","activityBar.foreground":"#9E9E9E","activityBarBadge.background":"#616161","badge.background":"#E0E0E0","badge.foreground":"#616161","button.background":"#757575","button.hoverBackground":"#616161","debugIcon.breakpointCurrentStackframeForeground":"#1976D2","debugIcon.breakpointDisabledForeground":"#848484","debugIcon.breakpointForeground":"#D32F2F","debugIcon.breakpointStackframeForeground":"#1976D2","debugIcon.continueForeground":"#6f42c1","debugIcon.disconnectForeground":"#6f42c1","debugIcon.pauseForeground":"#6f42c1","debugIcon.restartForeground":"#1976D2","debugIcon.startForeground":"#1976D2","debugIcon.stepBackForeground":"#6f42c1","debugIcon.stepIntoForeground":"#6f42c1","debugIcon.stepOutForeground":"#6f42c1","debugIcon.stepOverForeground":"#6f42c1","debugIcon.stopForeground":"#1976D2","diffEditor.insertedTextBackground":"#b7e7a44b","diffEditor.removedTextBackground":"#e597af52","editor.background":"#ffffff","editor.foreground":"#212121","editor.lineHighlightBorder":"#f2f2f2","editorBracketMatch.background":"#E7F3FF","editorBracketMatch.border":"#c8e1ff","editorGroupHeader.tabsBackground":"#f6f6f6","editorGroupHeader.tabsBorder":"#fff","editorIndentGuide.background":"#EEE","editorLineNumber.activeForeground":"#757575","editorLineNumber.foreground":"#CCC","editorSuggestWidget.background":"#F3F3F3","extensionButton.prominentBackground":"#000000AA","extensionButton.prominentHoverBackground":"#000000BB","focusBorder":"#D0D0D0","foreground":"#757575","gitDecoration.ignoredResourceForeground":"#AAAAAA","input.border":"#E9E9E9","inputOption.activeBackground":"#EDEDED","list.activeSelectionBackground":"#EEE","list.activeSelectionForeground":"#212121","list.focusBackground":"#ddd","list.focusForeground":"#212121","list.highlightForeground":"#212121","list.inactiveSelectionBackground":"#E0E0E0","list.inactiveSelectionForeground":"#212121","panel.background":"#fff","panel.border":"#f4f4f4","panelTitle.activeBorder":"#fff","panelTitle.inactiveForeground":"#BDBDBD","peekView.border":"#E0E0E0","peekViewEditor.background":"#f8f8f8","pickerGroup.foreground":"#000","progressBar.background":"#000","scrollbar.shadow":"#FFF","sideBar.background":"#f6f6f6","sideBar.border":"#f6f6f6","sideBarSectionHeader.background":"#EEE","sideBarTitle.foreground":"#999","statusBar.background":"#f6f6f6","statusBar.border":"#f6f6f6","statusBar.debuggingBackground":"#f6f6f6","statusBar.foreground":"#7E7E7E","statusBar.noFolderBackground":"#f6f6f6","statusBarItem.prominentBackground":"#0000001a","statusBarItem.remoteBackground":"#f6f6f600","statusBarItem.remoteForeground":"#7E7E7E","symbolIcon.classForeground":"#dd8500","symbolIcon.constructorForeground":"#6f42c1","symbolIcon.enumeratorForeground":"#dd8500","symbolIcon.enumeratorMemberForeground":"#1976D2","symbolIcon.eventForeground":"#dd8500","symbolIcon.fieldForeground":"#1976D2","symbolIcon.functionForeground":"#6f42c1","symbolIcon.interfaceForeground":"#1976D2","symbolIcon.methodForeground":"#6f42c1","symbolIcon.variableForeground":"#1976D2","tab.activeBorder":"#FFF","tab.activeForeground":"#424242","tab.border":"#f6f6f6","tab.inactiveBackground":"#f6f6f6","tab.inactiveForeground":"#BDBDBD","tab.unfocusedActiveBorder":"#fff","terminal.ansiBlack":"#333","terminal.ansiBlue":"#e0e0e0","terminal.ansiBrightBlack":"#a1a1a1","terminal.ansiBrightBlue":"#6871ff","terminal.ansiBrightCyan":"#57d9ad","terminal.ansiBrightGreen":"#a3d900","terminal.ansiBrightMagenta":"#a37acc","terminal.ansiBrightRed":"#d6656a","terminal.ansiBrightWhite":"#7E7E7E","terminal.ansiBrightYellow":"#e7c547","terminal.ansiCyan":"#4dbf99","terminal.ansiGreen":"#77cc00","terminal.ansiMagenta":"#9966cc","terminal.ansiRed":"#D32F2F","terminal.ansiWhite":"#c7c7c7","terminal.ansiYellow":"#f29718","terminal.background":"#fff","textLink.activeForeground":"#000","textLink.foreground":"#000","titleBar.activeBackground":"#f6f6f6","titleBar.border":"#FFFFFF00","titleBar.inactiveBackground":"#f6f6f6"},"displayName":"Min Light","name":"min-light","tokenColors":[{"settings":{"foreground":"#24292eff"}},{"scope":["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],"settings":{"foreground":"#24292eff"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":["strong","markup.heading.markdown","markup.bold.markdown"],"settings":{"fontStyle":"bold"}},{"scope":["markup.italic.markdown"],"settings":{"fontStyle":"italic"}},{"scope":"meta.link.inline.markdown","settings":{"fontStyle":"underline","foreground":"#1976D2"}},{"scope":["string","markup.fenced_code","markup.inline"],"settings":{"foreground":"#2b5581"}},{"scope":["comment","string.quoted.docstring.multi"],"settings":{"foreground":"#c2c3c5"}},{"scope":["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],"settings":{"foreground":"#1976D2"}},{"scope":["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],"settings":{"foreground":"#D32F2F"}},{"scope":"variable.parameter.function","settings":{"foreground":"#FF9800"}},{"scope":["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],"settings":{"foreground":"#6f42c1"}},{"scope":["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],"settings":{"foreground":"#22863a"}},{"scope":"token.info-token","settings":{"foreground":"#316bcd"}},{"scope":"token.warn-token","settings":{"foreground":"#cd9731"}},{"scope":"token.error-token","settings":{"foreground":"#cd3131"}},{"scope":"token.debug-token","settings":{"foreground":"#800080"}},{"scope":["strong","markup.heading.markdown","markup.bold.markdown"],"settings":{"foreground":"#6f42c1"}},{"scope":["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],"settings":{"foreground":"#212121"}},{"scope":["markup.underline.link","punctuation.definition.metadata.markdown"],"settings":{"foreground":"#22863a"}},{"scope":["beginning.punctuation.definition.list.markdown"],"settings":{"foreground":"#6f42c1"}},{"scope":["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],"settings":{"foreground":"#d32f2f"}}],"type":"light"}'));export{e as default};
@@ -0,0 +1 @@
1
+ var v=Object.defineProperty;var l=(t,e)=>v(t,"name",{value:e,configurable:!0});import{sanitize as u}from"isomorphic-dompurify";var y=Object.defineProperty,n=l((t,e)=>y(t,"name",{value:e,configurable:!0}),"r$1");const w=["http://","https://","/","./","../"],g="#",D={'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;"},x=/^[\w+/-]+={0,2}$/,a=n(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()},"toString"),d=n(t=>t.replaceAll(/[&<>"']/g,e=>D[e]),"escapeHtml"),C=n(t=>{try{return u(a(t))}catch{return d(a(t))}},"sanitizeHtml"),H=n(t=>{const e=a(t);if(!e)return"";try{return u(e).replaceAll('"',"&quot;").replaceAll("'","&#39;")}catch{return d(e)}},"sanitizeAttribute"),A=n(t=>{const e=a(t);if(!e)return g;try{const i=u(e),s=i.toLowerCase();return w.some(o=>s.startsWith(o))?i:g}catch{return g}},"sanitizeUrlAttribute"),$=n(t=>{const e=a(t);if(!e)return"";try{return u(e,{ADD_ATTR:["class","style"]})}catch{return C(e)}},"sanitizeCodeHtml"),b=n(t=>{const e=a(t);if(e)return x.test(e)?e:void 0},"sanitizeCspNonce"),N=n((t={})=>{try{return{...t,cspNonce:b(t.cspNonce),openInEditorUrl:t.openInEditorUrl?A(t.openInEditorUrl):void 0}}catch{return{...t,cspNonce:void 0,openInEditorUrl:void 0}}},"sanitizeOptions");var j=Object.defineProperty,r=l((t,e)=>j(t,"name",{value:e,configurable:!0}),"t");const h={javascript:r(()=>import("@shikijs/langs/javascript"),"javascript"),typescript:r(()=>import("@shikijs/langs/typescript"),"typescript"),jsx:r(()=>import("@shikijs/langs/jsx"),"jsx"),tsx:r(()=>import("@shikijs/langs/tsx"),"tsx"),json:r(()=>import("@shikijs/langs/json"),"json"),jsonc:r(()=>import("@shikijs/langs/jsonc"),"jsonc"),xml:r(()=>import("@shikijs/langs/xml"),"xml"),sql:r(()=>import("@shikijs/langs/sql"),"sql"),markdown:r(()=>import("@shikijs/langs/markdown"),"markdown"),mdx:r(()=>import("@shikijs/langs/mdx"),"mdx"),html:r(()=>import("@shikijs/langs/html"),"html"),css:r(()=>import("@shikijs/langs/css"),"css"),scss:r(()=>import("@shikijs/langs/scss"),"scss"),less:r(()=>import("@shikijs/langs/less"),"less"),sass:r(()=>import("@shikijs/langs/sass"),"sass"),stylus:r(()=>import("@shikijs/langs/stylus"),"stylus"),styl:r(()=>import("@shikijs/langs/styl"),"styl"),svelte:r(()=>import("@shikijs/langs/svelte"),"svelte"),vue:r(()=>import("@shikijs/langs/vue"),"vue"),bash:r(()=>import("@shikijs/langs/bash"),"bash"),shell:r(()=>import("@shikijs/langs/shell"),"shell"),text:r(()=>Promise.resolve({name:"text",patterns:[],scopeName:"source.text",repository:{}}),"text")};r(async t=>{if(typeof t!="string"||!t)return;const e=h[t.toLowerCase()];if(e)return await e()},"getLanguageImport");var F=Object.defineProperty,c=l((t,e)=>F(t,"name",{value:e,configurable:!0}),"a$1");let p,m;const L=c(async()=>{const[t,e]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:i}=t,{createJavaScriptRegexEngine:s}=e,o=await i({themes:[import("../packem_chunks/min-dark.js"),import("../packem_chunks/min-light.js")],langs:[],engine:s()}),f=o;return m=c(()=>{try{o?.dispose?.()}catch{}p=void 0},"disposeFn"),f},"createSingletonHighlighter"),z=c(async(t,e)=>{if(e==="text")return;const i=e.toLowerCase();if(!(t.getLoadedLanguages?.()??t.getLanguages?.()??[]).includes(i)){const s=h[i];s&&await t.loadLanguage?.(await s())}},"ensureLanguageLoaded"),O=c(async(t=[])=>{p||(p=L());const e=await p,i=[];for(const s of t)if(typeof s=="string")i.push(s.toLowerCase());else{const o=s.name;o&&i.push(o.toLowerCase())}return await Promise.all(i.map(s=>z(e,s))),e},"getHighlighter");c(async()=>{try{m&&(m(),m=void 0)}catch{}},"disposeHighlighter");c((t=[])=>({name:"@shikijs/transformers:compact-line-options",line(e,i){const s=t.find(o=>o.line===i);return s?.classes&&this.addClassToHast(e,s.classes),e}}),"transformerCompactLineOptions");const P="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",U="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{H as a,b,A as c,O as d,P as e,N as f,$ as g,U as n,C as s};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var o=(r,e)=>i(r,"name",{value:e,configurable:!0});var l=Object.defineProperty,a=o((r,e)=>l(r,"name",{value:e,configurable:!0}),"r");const g=globalThis.process||Object.create(null),t={versions:{}},c=new Proxy(g,{get(r,e){if(e in r)return r[e];if(e in t)return t[e]}});let s,n;const f=a(()=>(s??=c.version??"",s),"getProcessVersion"),u=a(()=>(n??=c.platform??"",n),"getProcessPlatform");export{u as a,f as g,c as n};
@@ -0,0 +1,50 @@
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
+ type Theme = "dark" | "light" | "auto";
34
+ type ContentPage = {
35
+ code: {
36
+ html: string;
37
+ script?: string;
38
+ };
39
+ defaultSelected?: boolean;
40
+ id: string;
41
+ name: string;
42
+ };
43
+ type TemplateOptions = {
44
+ content?: ContentPage[];
45
+ cspNonce?: string;
46
+ editor?: Editors;
47
+ openInEditorUrl?: string;
48
+ theme?: Theme;
49
+ };
50
+ 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-B37didfB.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,Se=c(e=>{const t=e.map(o=>o.source).join("|")||"$^",n=e[0]?.flags;return new RegExp(t,n)},"ve"),ke=Se,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("|")),St=p(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>fe(t,n).join("|")),kt=p(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>fe(t.toLowerCase(),n.toLowerCase()).join("|").toUpperCase()),It=j([Rt,St,kt]),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)=>ke(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,k=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=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"),S=w(s=>gn.test(s),"isAbsolute"),U=w(function(s){if(s.length===0)return".";s=k(s);const a=hn.exec(s),i=S(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&&!S(s)?`/${s}`:s)},"normalize");w((...s)=>{let a="";for(const i of s)if(i)if(a.length>0){const u=a[a.length-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=>k(u));let a="",i=!1;for(let u=s.length-1;u>=-1&&!i;u--){const d=u>=0?s[u]:$n();!d||d.length===0||(a=`${d}/${a}`,i=S(d))}return a=_e(a,!i),i&&!S(a)?`/${a}`:a.length>0?a:"."},"resolve");w(function(s){return k(s)},"toNamespacedPath");const yn=w(function(s){return xn.exec(k(s))?.[1]??""},"extname"),wn=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"),bn=w(s=>{const a=k(s).replace(/\/$/,"").split("/").slice(0,-1);return a.length===1&&Oe.test(a[0])&&(a[0]+="/"),a.join("/")||(S(s)?"/":".")},"dirname");w(function(s){const a=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return k(s.root?G(...a):a.join("/"))},"format");const vn=w((s,a)=>{const i=k(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=vn(s),u=yn(i);return{base:i,dir:bn(s),ext:u,name:i.slice(0,i.length-u.length),root:a}},"parse");w((s,a)=>cn(a,U(s)),"matchesGlob");var jn=Object.defineProperty,M=T((s,a)=>jn(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(String(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=S(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=wn(v,O);if(I.startsWith("..")||S(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",String(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"),zn=M((s={})=>{const a=ze(s);return async(i,u)=>a(i,u)},"createNodeHttpHandler"),An=M((s={})=>ze(s),"createExpressHandler");export{An as createExpressHandler,zn as createNodeHttpHandler,ze as createOpenInEditorMiddleware};
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:ye}=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(()=>we,"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"),E=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=>E(h,t,n)).filter(Boolean));if(f?.length){const h=e.children.some(L=>!L.regex||!(L.partial??t)),w=f.length>1||r&&(!l.length||h);l+=w?r?"(?:$|":"(?:":"",l+=f.join("|"),l+=w?")":""}}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=E(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 ze=I,Ae=c((e,t)=>{const n=ze.compile(e,t),o=`${n.source.slice(0,-1)}[\\\\/]?$`,r=n.flags;return new RegExp(o,r)},"le"),Re=Ae,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"),_=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=z(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(!_(t)&&!o.options.silent){const h=r.slice(l,f),w=q(t)?t(h,r,`${l}`):t;_(w)||o.output.push(w)}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}`);_(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(!_(t)&&!n.options.silent){const f=q(t)?t(r.slice(o,l),r,`${o}`):t;_(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(!_(t)&&!n.options.silent){const l=q(t)?t(e,r,`${o}`):t;_(l)||n.output.push(l)}return n.index+=e.length,!0}else return!1},"F"),V=c((e,t,n,o)=>{const r=z(e),l=t>1;return Q(K(ie(f=>{let h=0;for(;h<n;){const w=f.index;if(!r(f)||(h+=1,f.index===w))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(z);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(z);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=z(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=z(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 _(f)||o.output.push(f),!0}else return!1}:n},"B"),Q=(()=>{let e=0;return t=>{const n=z(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:[]}),w=h.queue;if(f<=h.indexMax){const Z=h.store||(h.store=new Map);if(w.length){for(let C=0,Kt=w.length;C<Kt;C+=2){const Qt=w[C*2],Xt=w[C*2+1];Z.set(Qt,Xt)}w.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);w.push(f,{index:Z,output:C})}else w.push(f,Z);return!0}else return w.push(f,!1),!1}}})(),le=c(e=>{let t;return n=>(t||(t=z(e())),t(n))},"G"),z=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]}})(),A=c(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),it=p(/\\./,$),lt=p(/[$.*+?^(){}[\]\|]/,e=>$(`\\${e}`)),ct=p(/[\\\/]/,A),ut=p(/[^$.*+?^(){}[\]\|\\\/]+/,$),ft=p(/^(?:!!)*!(.*)$/,(e,t)=>$(`(?!^${we.compile(t).source}$).*?`)),pt=p(/^(!!)+/),dt=j([ft,pt]),ht=p(/\/(\*\*\/)+/,()=>N([W([A(),$(".+?"),A()]),A()])),gt=p(/^(\*\*\/)+/,()=>N([$("^"),W([$(".*?"),A()])])),xt=p(/\/(\*\*)$/,()=>N([W([A(),$(".*?")]),$("$")])),mt=p(/\*\*/,()=>$(".*?")),pe=j([ht,gt,xt,mt]),$t=p(/\*\/(?!\*\*\/|\*$)/,()=>W([$("[^\\\\/]*?"),A()])),wt=p(/\*/,()=>$("[^\\\\/]*")),de=j([$t,wt]),he=p("?",()=>$("[^\\\\/]")),yt=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(/[\\\/]/,"\\\\/"),Et=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),_t=j([Pt,Mt,Ot,jt,Et]),ge=B([yt,ae(vt),F(_t),bt],e=>$(e.join(""))),zt=p("{","(?:"),At=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([zt,It,At],e=>$(e.join(""))),Bt=p("{"),Wt=p("}"),Ct=p(","),qt=p(/\\./,$),Nt=p(/[$.*+?^(){[\]\|]/,e=>$(`\\${e}`)),Lt=p(/[\\\/]/,A),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 we=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,y=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=/\/$/,wn=y(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Pe="/",Ee=y((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=y(s=>gn.test(s),"isAbsolute"),U=y(function(s){if(s.length===0)return".";s=S(s);const a=hn.exec(s),i=k(s),u=s.at(-1)==="/";return s=Ee(s,!i),s.length===0?i?"/":u?"./":".":(u&&(s+="/"),Oe.test(s)&&(s+="/"),a?i?`//${s}`:`//./${s}`:i&&!k(s)?`/${s}`:s)},"normalize");y((...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=y(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]:wn();!d||d.length===0||(a=`${d}/${a}`,i=k(d))}return a=Ee(a,!i),i&&!k(a)?`/${a}`:a.length>0?a:"."},"resolve");y(function(s){return S(s)},"toNamespacedPath");const yn=y(function(s){return xn.exec(S(s))?.[1]??""},"extname"),bn=y(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=y(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");y(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=y((s,a)=>{const i=S(s).split("/").pop();return a&&i.endsWith(a)?i.slice(0,-a.length):i},"basename");y(function(s){const a=mn.exec(s)?.[0]?.replaceAll("\\","/")??"",i=jn(s),u=yn(i);return{base:i,dir:vn(s),ext:u,name:i.slice(0,i.length-u.length),root:a}},"parse");y((s,a)=>cn(a,U(s)),"matchesGlob");var Pn=Object.defineProperty,M=T((s,a)=>Pn(s,"name",{value:a,configurable:!0}),"i");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"),_e=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=ye(d),b=ye(x),v=U(m),O=U(b),E=be()==="win32"||be()==="darwin",D=E?v.toLowerCase():v,J=E?O.toLowerCase():O,I=bn(v,O);if(I.startsWith("..")||k(I)||E&&!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(E=>{v(u,d,()=>{E()})})}catch{Me(d)}},"universalHandler")},"createOpenInEditorMiddleware"),zn=M((s={})=>{const a=_e(s);return async(i,u)=>a(i,u)},"createNodeHttpHandler"),An=M((s={})=>_e(s),"createExpressHandler");export{An as createExpressHandler,zn as createNodeHttpHandler,_e as createOpenInEditorMiddleware};
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "name": "@visulima/ono",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-alpha.31",
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
- "homepage": "https://www.visulima.com/docs/package/ono",
33
+ "homepage": "https://visulima.com/packages/ono/",
34
34
  "repository": {
35
35
  "type": "git",
36
36
  "url": "https://github.com/visulima/visulima.git",
@@ -80,12 +80,12 @@
80
80
  "clean": "rimraf node_modules dist .eslintcache",
81
81
  "dev:hono": "packem build --development --watch --onSuccess 'node ./examples/hono/index.js'",
82
82
  "dev:node": "packem build --development --watch --onSuccess 'node ./examples/node/index.js'",
83
- "lint:attw": "attw --pack",
83
+ "lint:attw": "attw --pack --profile esm-only",
84
84
  "lint:eslint": "eslint . --cache --concurrency auto",
85
85
  "lint:eslint:fix": "eslint . --cache --concurrency auto --fix",
86
86
  "lint:package-json": "publint --strict",
87
- "lint:prettier": "prettier --config=.prettierrc.cjs --check .",
88
- "lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
87
+ "lint:prettier": "prettier --config=prettier.config.js --check .",
88
+ "lint:prettier:fix": "prettier --config=prettier.config.js --write .",
89
89
  "lint:types": "tsc --noEmit",
90
90
  "test": "vitest run",
91
91
  "test:coverage": "vitest run --coverage",
@@ -93,55 +93,55 @@
93
93
  "test:watch": "vitest"
94
94
  },
95
95
  "dependencies": {
96
- "@shikijs/langs": "^3.19.0",
97
- "@visulima/error": "6.0.0-alpha.2",
98
- "isomorphic-dompurify": "^2.34.0",
99
- "launch-editor-middleware": "2.12.0",
100
- "shiki": "^3.19.0"
96
+ "@shikijs/langs": "catalog:prod",
97
+ "@visulima/error": "6.0.0-alpha.28",
98
+ "isomorphic-dompurify": "catalog:prod",
99
+ "launch-editor-middleware": "catalog:prod",
100
+ "shiki": "catalog:syntax"
101
101
  },
102
102
  "devDependencies": {
103
- "@anolilab/eslint-config": "^17.0.0",
104
- "@anolilab/prettier-config": "^7.0.0",
105
- "@anolilab/semantic-release-preset": "^12.1.2",
106
- "@arethetypeswrong/cli": "^0.18.2",
107
- "@eslint/css": "0.14.1",
108
- "@shikijs/themes": "^3.19.0",
109
- "@tailwindcss/forms": "^0.5.10",
110
- "@tailwindcss/node": "^4.1.17",
111
- "@tailwindcss/oxide": "^4.1.17",
112
- "@tailwindcss/typography": "^0.5.19",
113
- "@total-typescript/ts-reset": "^0.6.1",
114
- "@types/http-errors": "^2.0.5",
115
- "@types/node": "25.0.0",
116
- "@visulima/packem": "2.0.0-alpha.40",
117
- "@visulima/path": "3.0.0-alpha.3",
118
- "@vitest/coverage-v8": "^4.0.15",
119
- "cssnano": "7.1.2",
120
- "esbuild": "0.27.1",
121
- "eslint": "^9.39.1",
122
- "http-errors": "^2.0.1",
123
- "lucide-static": "^0.559.0",
124
- "marked": "^17.0.1",
125
- "node-mocks-http": "^1.17.2",
126
- "openai": "6.10.0",
127
- "prettier": "^3.7.4",
128
- "prettier-plugin-tailwindcss": "0.7.2",
129
- "publint": "^0.3.16",
130
- "rimraf": "^6.1.2",
131
- "semantic-release": "^25.0.2",
132
- "sort-package-json": "^3.5.1",
133
- "tailwind-csstree": "0.1.4",
134
- "tailwindcss": "^4.1.17",
135
- "typescript": "^5.9.3",
136
- "vitest": "^4.0.15"
103
+ "@anolilab/eslint-config": "catalog:lint",
104
+ "@anolilab/prettier-config": "catalog:lint",
105
+ "@anolilab/semantic-release-preset": "catalog:dev",
106
+ "@arethetypeswrong/cli": "catalog:dev",
107
+ "@eslint/css": "catalog:lint",
108
+ "@shikijs/themes": "catalog:dev",
109
+ "@tailwindcss/forms": "catalog:frontend",
110
+ "@tailwindcss/node": "catalog:frontend",
111
+ "@tailwindcss/oxide": "catalog:frontend",
112
+ "@tailwindcss/typography": "catalog:style",
113
+ "@total-typescript/ts-reset": "catalog:dev",
114
+ "@types/http-errors": "catalog:types",
115
+ "@types/node": "catalog:types",
116
+ "@visulima/packem": "catalog:dev",
117
+ "@visulima/path": "3.0.0-alpha.10",
118
+ "@vitest/coverage-v8": "catalog:test",
119
+ "cssnano": "catalog:dev",
120
+ "esbuild": "catalog:build",
121
+ "eslint": "catalog:lint",
122
+ "http-errors": "catalog:dev",
123
+ "lucide-static": "catalog:icons",
124
+ "marked": "catalog:dev",
125
+ "node-mocks-http": "catalog:dev",
126
+ "openai": "catalog:dev",
127
+ "prettier": "catalog:lint",
128
+ "prettier-plugin-tailwindcss": "catalog:lint",
129
+ "publint": "catalog:dev",
130
+ "rimraf": "catalog:node",
131
+ "semantic-release": "catalog:cli",
132
+ "sort-package-json": "catalog:dev",
133
+ "tailwind-csstree": "catalog:dev",
134
+ "tailwindcss": "catalog:style",
135
+ "typescript": "catalog:tsc",
136
+ "vitest": "catalog:test"
137
137
  },
138
138
  "peerDependencies": {
139
- "@ai-sdk/anthropic": "^1.0.9",
140
- "@ai-sdk/azure": "^1.0.22",
141
- "@ai-sdk/google": "^1.0.17",
142
- "@ai-sdk/mistral": "^1.0.9",
143
- "@ai-sdk/openai": "^1.0.20",
144
- "ai": "^4.0.0 || ^5.0.0"
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": "^6.0.175"
145
145
  },
146
146
  "peerDependenciesMeta": {
147
147
  "@ai-sdk/anthropic": {
@@ -167,7 +167,7 @@
167
167
  }
168
168
  },
169
169
  "engines": {
170
- "node": ">=22.13 <=25.x"
170
+ "node": "^22.14.0 || >=24.10.0"
171
171
  },
172
172
  "publishConfig": {
173
173
  "access": "public",
@@ -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;