@visulima/cerebro 3.0.0-alpha.25 → 3.0.0-alpha.27
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 +28 -0
- package/LICENSE.md +132 -2
- package/dist/commands/completion-command.d.ts +1 -1
- package/dist/commands/help-command.d.ts +1 -1
- package/dist/commands/readme-command.d.ts +1 -1
- package/dist/commands/version-command.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/packem_shared/{VisulimaError-Bh91XNXu.js → VisulimaError-WfDZ45Qv.js} +1 -1
- package/dist/packem_shared/{plugin-manager.d-Du-YXFui.d.ts → plugin-manager.d-Dz-wu1tI.d.ts} +3 -0
- package/dist/packem_shared/renderError-DxgI44AK-DFDWFoCr.js +24 -0
- package/dist/plugins/error-handler-plugin.d.ts +1 -1
- package/dist/plugins/error-handler-plugin.js +1 -1
- package/dist/plugins/runtime-version-check-plugin.d.ts +1 -1
- package/dist/plugins/update-notifier/update-notifier-plugin.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packem_shared/renderError-B_XyYPKJ-B65kP-Ou.js +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## @visulima/cerebro [3.0.0-alpha.27](https://github.com/visulima/visulima/compare/@visulima/cerebro@3.0.0-alpha.26...@visulima/cerebro@3.0.0-alpha.27) (2026-05-26)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
|
|
6
|
+
* **repo:** apply eslint --fix and prettier --fix across packages ([#650](https://github.com/visulima/visulima/issues/650)) ([2e26a84](https://github.com/visulima/visulima/commit/2e26a84774f218f21345e9a8ecd68236b6542743)), closes [#620](https://github.com/visulima/visulima/issues/620)
|
|
7
|
+
|
|
8
|
+
### Tests
|
|
9
|
+
|
|
10
|
+
* **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* **@visulima/error:** upgraded to 6.0.0-alpha.28
|
|
16
|
+
* **@visulima/pail:** upgraded to 4.0.0-alpha.17
|
|
17
|
+
|
|
18
|
+
## @visulima/cerebro [3.0.0-alpha.26](https://github.com/visulima/visulima/compare/@visulima/cerebro@3.0.0-alpha.25...@visulima/cerebro@3.0.0-alpha.26) (2026-05-20)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **cerebro:** add blank line before re-keying nested namesake ([ad40fec](https://github.com/visulima/visulima/commit/ad40fec43b255673fbf09399b6a99c6d596c0d23))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* **@visulima/error:** upgraded to 6.0.0-alpha.27
|
|
28
|
+
|
|
1
29
|
## @visulima/cerebro [3.0.0-alpha.25](https://github.com/visulima/visulima/compare/@visulima/cerebro@3.0.0-alpha.24...@visulima/cerebro@3.0.0-alpha.25) (2026-05-19)
|
|
2
30
|
|
|
3
31
|
|
package/LICENSE.md
CHANGED
|
@@ -169,11 +169,14 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
169
169
|
>
|
|
170
170
|
>
|
|
171
171
|
> # Licenses of bundled types
|
|
172
|
+
>
|
|
172
173
|
> The published @visulima/command-line-args artifact additionally contains code with the following licenses:
|
|
173
174
|
> MIT
|
|
174
175
|
>
|
|
175
176
|
> # Bundled types:
|
|
177
|
+
>
|
|
176
178
|
> ## @visulima/error
|
|
179
|
+
>
|
|
177
180
|
> License: MIT
|
|
178
181
|
> By: Daniel Bannert
|
|
179
182
|
> Repository: git+https://github.com/visulima/visulima.git
|
|
@@ -201,6 +204,40 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
201
204
|
> > SOFTWARE.
|
|
202
205
|
> >
|
|
203
206
|
> >
|
|
207
|
+
>
|
|
208
|
+
> # Licenses of bundled dependencies
|
|
209
|
+
> The published @visulima/command-line-args artifact additionally contains code with the following licenses:
|
|
210
|
+
> MIT
|
|
211
|
+
>
|
|
212
|
+
> # Bundled dependencies:
|
|
213
|
+
> ## @visulima/error
|
|
214
|
+
> License: MIT
|
|
215
|
+
> By: Daniel Bannert
|
|
216
|
+
> Repository: git+https://github.com/visulima/visulima.git
|
|
217
|
+
>
|
|
218
|
+
> > MIT License
|
|
219
|
+
> >
|
|
220
|
+
> > Copyright (c) 2026 visulima
|
|
221
|
+
> >
|
|
222
|
+
> > Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
223
|
+
> > of this software and associated documentation files (the "Software"), to deal
|
|
224
|
+
> > in the Software without restriction, including without limitation the rights
|
|
225
|
+
> > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
226
|
+
> > copies of the Software, and to permit persons to whom the Software is
|
|
227
|
+
> > furnished to do so, subject to the following conditions:
|
|
228
|
+
> >
|
|
229
|
+
> > The above copyright notice and this permission notice shall be included in all
|
|
230
|
+
> > copies or substantial portions of the Software.
|
|
231
|
+
> >
|
|
232
|
+
> > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
233
|
+
> > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
234
|
+
> > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
235
|
+
> > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
236
|
+
> > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
237
|
+
> > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
238
|
+
> > SOFTWARE.
|
|
239
|
+
> >
|
|
240
|
+
> >
|
|
204
241
|
> >
|
|
205
242
|
> > # Licenses of bundled dependencies
|
|
206
243
|
> >
|
|
@@ -225,7 +262,7 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
225
262
|
> > >
|
|
226
263
|
> > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
227
264
|
> >
|
|
228
|
-
> >
|
|
265
|
+
> >
|
|
229
266
|
> >
|
|
230
267
|
> >
|
|
231
268
|
> >
|
|
@@ -251,6 +288,34 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
251
288
|
> > > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
252
289
|
> > > See the License for the specific language governing permissions and
|
|
253
290
|
> > > limitations under the License.
|
|
291
|
+
>
|
|
292
|
+
>
|
|
293
|
+
>
|
|
294
|
+
> > # Licenses of bundled types
|
|
295
|
+
> >
|
|
296
|
+
> > The published @visulima/error artifact additionally contains code with the following licenses:
|
|
297
|
+
> > Apache-2.0
|
|
298
|
+
> >
|
|
299
|
+
> > # Bundled types:
|
|
300
|
+
> >
|
|
301
|
+
> > ## ai
|
|
302
|
+
> >
|
|
303
|
+
> > License: Apache-2.0
|
|
304
|
+
> > Repository: git+https://github.com/vercel/ai.git
|
|
305
|
+
> >
|
|
306
|
+
> > > Copyright 2023 Vercel, Inc.
|
|
307
|
+
> > >
|
|
308
|
+
> > > Licensed under the Apache License, Version 2.0 (the "License");
|
|
309
|
+
> > > you may not use this file except in compliance with the License.
|
|
310
|
+
> > > You may obtain a copy of the License at
|
|
311
|
+
> > >
|
|
312
|
+
> > > http://www.apache.org/licenses/LICENSE-2.0
|
|
313
|
+
> > >
|
|
314
|
+
> > > Unless required by applicable law or agreed to in writing, software
|
|
315
|
+
> > > distributed under the License is distributed on an "AS IS" BASIS,
|
|
316
|
+
> > > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
317
|
+
> > > See the License for the specific language governing permissions and
|
|
318
|
+
> > > limitations under the License.
|
|
254
319
|
|
|
255
320
|
---------------------------------------
|
|
256
321
|
|
|
@@ -638,11 +703,14 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
638
703
|
>
|
|
639
704
|
>
|
|
640
705
|
> # Licenses of bundled types
|
|
706
|
+
>
|
|
641
707
|
> The published @visulima/command-line-args artifact additionally contains code with the following licenses:
|
|
642
708
|
> MIT
|
|
643
709
|
>
|
|
644
710
|
> # Bundled types:
|
|
711
|
+
>
|
|
645
712
|
> ## @visulima/error
|
|
713
|
+
>
|
|
646
714
|
> License: MIT
|
|
647
715
|
> By: Daniel Bannert
|
|
648
716
|
> Repository: git+https://github.com/visulima/visulima.git
|
|
@@ -670,6 +738,40 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
670
738
|
> > SOFTWARE.
|
|
671
739
|
> >
|
|
672
740
|
> > <!-- DEPENDENCIES -->
|
|
741
|
+
>
|
|
742
|
+
> # Licenses of bundled dependencies
|
|
743
|
+
> The published @visulima/command-line-args artifact additionally contains code with the following licenses:
|
|
744
|
+
> MIT
|
|
745
|
+
>
|
|
746
|
+
> # Bundled dependencies:
|
|
747
|
+
> ## @visulima/error
|
|
748
|
+
> License: MIT
|
|
749
|
+
> By: Daniel Bannert
|
|
750
|
+
> Repository: git+https://github.com/visulima/visulima.git
|
|
751
|
+
>
|
|
752
|
+
> > MIT License
|
|
753
|
+
> >
|
|
754
|
+
> > Copyright (c) 2026 visulima
|
|
755
|
+
> >
|
|
756
|
+
> > Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
757
|
+
> > of this software and associated documentation files (the "Software"), to deal
|
|
758
|
+
> > in the Software without restriction, including without limitation the rights
|
|
759
|
+
> > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
760
|
+
> > copies of the Software, and to permit persons to whom the Software is
|
|
761
|
+
> > furnished to do so, subject to the following conditions:
|
|
762
|
+
> >
|
|
763
|
+
> > The above copyright notice and this permission notice shall be included in all
|
|
764
|
+
> > copies or substantial portions of the Software.
|
|
765
|
+
> >
|
|
766
|
+
> > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
767
|
+
> > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
768
|
+
> > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
769
|
+
> > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
770
|
+
> > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
771
|
+
> > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
772
|
+
> > SOFTWARE.
|
|
773
|
+
> >
|
|
774
|
+
> >
|
|
673
775
|
> >
|
|
674
776
|
> > # Licenses of bundled dependencies
|
|
675
777
|
> >
|
|
@@ -694,7 +796,7 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
694
796
|
> > >
|
|
695
797
|
> > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
696
798
|
> >
|
|
697
|
-
> >
|
|
799
|
+
> >
|
|
698
800
|
> >
|
|
699
801
|
> >
|
|
700
802
|
> >
|
|
@@ -720,6 +822,34 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
720
822
|
> > > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
721
823
|
> > > See the License for the specific language governing permissions and
|
|
722
824
|
> > > limitations under the License.
|
|
825
|
+
>
|
|
826
|
+
> <!-- /DEPENDENCIES -->
|
|
827
|
+
>
|
|
828
|
+
> > # Licenses of bundled types
|
|
829
|
+
> >
|
|
830
|
+
> > The published @visulima/error artifact additionally contains code with the following licenses:
|
|
831
|
+
> > Apache-2.0
|
|
832
|
+
> >
|
|
833
|
+
> > # Bundled types:
|
|
834
|
+
> >
|
|
835
|
+
> > ## ai
|
|
836
|
+
> >
|
|
837
|
+
> > License: Apache-2.0
|
|
838
|
+
> > Repository: git+https://github.com/vercel/ai.git
|
|
839
|
+
> >
|
|
840
|
+
> > > Copyright 2023 Vercel, Inc.
|
|
841
|
+
> > >
|
|
842
|
+
> > > Licensed under the Apache License, Version 2.0 (the "License");
|
|
843
|
+
> > > you may not use this file except in compliance with the License.
|
|
844
|
+
> > > You may obtain a copy of the License at
|
|
845
|
+
> > >
|
|
846
|
+
> > > http://www.apache.org/licenses/LICENSE-2.0
|
|
847
|
+
> > >
|
|
848
|
+
> > > Unless required by applicable law or agreed to in writing, software
|
|
849
|
+
> > > distributed under the License is distributed on an "AS IS" BASIS,
|
|
850
|
+
> > > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
851
|
+
> > > See the License for the specific language governing permissions and
|
|
852
|
+
> > > limitations under the License.
|
|
723
853
|
|
|
724
854
|
---------------------------------------
|
|
725
855
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OptionDefinition, A as ArgumentDefinition, C as Command, T as Toolbox } from "../packem_shared/plugin-manager.d-
|
|
1
|
+
import { O as OptionDefinition, A as ArgumentDefinition, C as Command, T as Toolbox } from "../packem_shared/plugin-manager.d-Dz-wu1tI.js";
|
|
2
2
|
import '@visulima/tabular';
|
|
3
3
|
declare class HelpCommand<TLogger extends Console = Console> implements Command<OptionDefinition<string>, TLogger> {
|
|
4
4
|
argument: ArgumentDefinition<string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as CommandSection, O as OptionDefinition, C as Command, P as Plugin, b as PluginManager, c as CliRunOptions, R as RunCommandOptions, d as Cli$1, L as LazyCommandModule } from "./packem_shared/plugin-manager.d-
|
|
2
|
-
export { type A as ArgumentDefinition, type e as CommandExecute, type E as EnvDefinition, type f as OutputType, type g as PluginContext, type T as Toolbox, type V as VERBOSITY_LEVEL } from "./packem_shared/plugin-manager.d-
|
|
1
|
+
import { a as CommandSection, O as OptionDefinition, C as Command, P as Plugin, b as PluginManager, c as CliRunOptions, R as RunCommandOptions, d as Cli$1, L as LazyCommandModule } from "./packem_shared/plugin-manager.d-Dz-wu1tI.js";
|
|
2
|
+
export { type A as ArgumentDefinition, type e as CommandExecute, type E as EnvDefinition, type f as OutputType, type g as PluginContext, type T as Toolbox, type V as VERBOSITY_LEVEL } from "./packem_shared/plugin-manager.d-Dz-wu1tI.js";
|
|
3
3
|
export { V as VisulimaError } from "./packem_shared/index.d-Br8HpP0A.js";
|
|
4
4
|
import '@visulima/tabular';
|
|
5
5
|
type CliOptions<T extends Console = Console> = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var U=Object.defineProperty;var s=(e,r)=>U(e,"name",{value:r,configurable:!0});import{createRequire as q}from"node:module";import{k as Dr,N as Jr,Q as Lr,G as Fr}from"./renderError-
|
|
1
|
+
var U=Object.defineProperty;var s=(e,r)=>U(e,"name",{value:r,configurable:!0});import{createRequire as q}from"node:module";import{k as Dr,N as Jr,Q as Lr,G as Fr}from"./renderError-DxgI44AK-DFDWFoCr.js";import{p as Mr,V as Vr}from"./isVisulimaError-jVZgumOU-C4fgdbWg.js";const z=q(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,B=s(e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[r,t]=g.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return g.getBuiltinModule(e)}return z(e)},"__cjs_getBuiltinModule"),{createRequire:K}=B("node:module");var Y=Object.defineProperty,H=s((e,r)=>Y(e,"name",{value:r,configurable:!0}),"s$7"),X=Object.defineProperty,W=H((e,r)=>X(e,"name",{value:r,configurable:!0}),"o"),G=Object.defineProperty,x=W((e,r)=>G(e,"name",{value:r,configurable:!0}),"l");const A=x((e,r)=>{let t=0,n=r.length-2;for(;t<n;){const o=t+(n-t>>1);if(e<r[o])n=o-1;else if(e>=r[o+1])t=o+1;else{t=o;break}}return t},"binarySearch"),Q=/\n|\r(?!\n)/,Z=x(e=>e.split(Q).reduce((r,t)=>(r.push(r.at(-1)+t.length+1),r),[0]),"getLineStartIndexes"),jr=x((e,r,t)=>{const n=t?.skipChecks??!1;if(!n&&(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0))return{column:0,line:0};if(!n&&(typeof r!="number"||typeof e=="string"&&r>=e.length||Array.isArray(e)&&r+1>=e.at(-1)))return{column:0,line:0};if(typeof e=="string"){const a=Z(e),i=A(r,a);return{column:r-a[i]+1,line:i+1}}const o=A(r,e);return{column:r-e[o]+1,line:o+1}},"indexToLineColumn");var ee=Object.defineProperty,re=s((e,r)=>ee(e,"name",{value:r,configurable:!0}),"t$5"),te=Object.defineProperty,ne=re((e,r)=>te(e,"name",{value:r,configurable:!0}),"i"),oe=Object.defineProperty,ae=ne((e,r)=>oe(e,"name",{value:r,configurable:!0}),"t");const Or=ae(({applicationType:e,error:r,file:t})=>`You are a very skilled ${t.language??"unknown"} programmer.
|
|
2
2
|
|
|
3
3
|
${e?`You are working on a ${e} application.`:""}
|
|
4
4
|
|
package/dist/packem_shared/{plugin-manager.d-Du-YXFui.d.ts → plugin-manager.d-Dz-wu1tI.d.ts}
RENAMED
|
@@ -38,6 +38,9 @@ interface OptionDefinition$1 {
|
|
|
38
38
|
*/
|
|
39
39
|
type?: (input: string) => any;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Error thrown when an option is already set (duplicate assignment).
|
|
43
|
+
*/
|
|
41
44
|
/** A Content section comprises a header and one or more lines of content. */
|
|
42
45
|
interface Content {
|
|
43
46
|
/**
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var Q=Object.defineProperty;var N=(r,e)=>Q(r,"name",{value:e,configurable:!0});import{createRequire as Y}from"node:module";const X=Y(import.meta.url),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Z=N(r=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[e,t]=S.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return S.getBuiltinModule(r)}return X(r)},"__cjs_getBuiltinModule"),{createRequire:ee}=Z("node:module");var re=Object.defineProperty,te=N((r,e)=>re(r,"name",{value:e,configurable:!0}),"A$2"),ie=Object.defineProperty,L=te((r,e)=>ie(r,"name",{value:e,configurable:!0}),"$"),ne=Object.defineProperty,oe=L((r,e)=>ne(r,"name",{value:e,configurable:!0}),"r$1");const se=oe(r=>r.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),"normalizeLF"),ae=globalThis.process??Object.create(null),P={versions:{}},_=new Proxy(ae,{get(r,e){if(e in r)return r[e];if(e in P)return P[e]}});var le=Object.defineProperty,ce=L((r,e)=>le(r,"name",{value:e,configurable:!0}),"b");const de=ce((r,e,t,i)=>{const s={column:0,line:-1,...r.start},o={...s,...r.end},n=s.line,l=s.column,d=o.line,c=o.column;let a=Math.max(n-(t+1),0),p=Math.min(e.length,d+i);n===-1&&(a=0),d===-1&&(p=e.length);const g=d-n,m={};if(g)for(let u=0;u<=g;u++){const $=u+n;if(!l)m[$]=!0;else if(u===0){const h=e[$-1]?.length;m[$]=[l,(h??0)-l+1]}else if(u===g)m[$]=[0,c];else{const h=e[$-u]?.length;m[$]=[0,h]}}else l===c?m[n]=l?[l,0]:!0:m[n]=[l,(c??0)-(l??0)];return{end:p,markerLines:m,start:a}},"getMarkerLines");var ue=Object.defineProperty,E=L((r,e)=>ue(r,"name",{value:e,configurable:!0}),"t");const fe=_.platform==="win32"&&!_.env?.WT_SESSION?">":"❯",me=E((r,e,t)=>{const i={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...t,color:{gutter:E(u=>u,"gutter"),marker:E(u=>u,"marker"),message:E(u=>u,"message"),...t?.color}},s=typeof e.start.column=="number";let o=se(r).split(`
|
|
3
|
+
`);typeof i.tabWidth=="number"&&(o=o.map(u=>u.replaceAll(" "," ".repeat(i.tabWidth))));const{end:n,markerLines:l,start:d}=de(e,o,i.linesAbove,i.linesBelow),c=String(n).length,{gutter:a,marker:p,message:g}=i.color;let m=o.slice(d,n).map((u,$)=>{const h=d+1+$,k=l[h],D=` ${String(h)}`.slice(-c),U=!l[h+1],j=` ${D}${i.showGutter?" |":""}`;if(k){let O="";if(Array.isArray(k)){const H=u.replaceAll(/[^\t]/g," ").slice(0,Math.max(k[0]-1,0)),K=k[1]||1;O=[`
|
|
4
|
+
`,i.prefix+a(j.replaceAll(/\d/g," "))," ",H,p("^").repeat(K)].join(""),U&&i.message&&(O+=` ${g(i.message)}`)}return[i.prefix+p(fe),a(j),u.length>0?` ${u}`:"",O].join("")}return`${i.prefix} ${a(j)}${u.length>0?` ${u}`:""}`}).join(`
|
|
5
|
+
`);return i.message&&!s&&(m=`${i.prefix+" ".repeat(c+1)+i.message}
|
|
6
|
+
${m}`),m},"codeFrame");var pe=Object.defineProperty,ve=N((r,e)=>pe(r,"name",{value:e,configurable:!0}),"x$1"),ge=Object.defineProperty,$e=ve((r,e)=>ge(r,"name",{value:e,configurable:!0}),"x"),he=Object.defineProperty,v=$e((r,e)=>he(r,"name",{value:e,configurable:!0}),"u");const b=v((r,...e)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${r}`,...e)},"debugLog"),y="<unknown>",be=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ye=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,xe=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,we=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Ne=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Se=/in\s(.*)\s\(at\s(.+)\)\sat/,ke=/^(?:.*@)?(.*):(\d+):(\d+)$/,Ee=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,je=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Oe=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,T=/\(error: (.*)\)/,Le=/at\s/,Ae=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Me=/\S*(?:Error: |AggregateError:)/,C=/^Anonymous function$/,Pe=/^\s*in\s.*/,_e=/^.*?\s*at\s.*/,Te=/^.*?\s*@.*|\[native code\]/,B=v((r,e)=>{const t=r.includes("safari-extension"),i=r.includes("safari-web-extension");return t||i?[r.includes("@")?r.split("@")[0]:y,t?`safari-extension:${e}`:`safari-web-extension:${e}`]:[r,e]},"extractSafariExtensionDetails"),W=v((r,e)=>{const t=xe.exec(e);t&&(r.file=t[1],r.line=+t[2],r.column=+t[3])},"parseMapped"),Ce=v(r=>{const e=Se.exec(r);if(e){b(`parse nested node error stack line: "${r}"`,`found: ${JSON.stringify(e)}`);const i=e[2].split(":");return{column:i[2]?+i[2]:void 0,file:i[0],line:i[1]?+i[1]:void 0,methodName:e[1]??y,raw:r,type:void 0}}const t=Ne.exec(r);if(t){b(`parse node error stack line: "${r}"`,`found: ${JSON.stringify(t)}`);const i={column:t[4]?+t[4]:void 0,file:t[2]?t[2].replace(Le,""):void 0,line:t[3]?+t[3]:void 0,methodName:t[1]??y,raw:r,type:r.startsWith("internal")?"internal":void 0};return W(i,`${t[2]}:${t[3]}:${t[4]}`),i}},"parseNode"),Be=v(r=>{const e=be.exec(r);if(e){b(`parse chrome error stack line: "${r}"`,`found: ${JSON.stringify(e)}`);const t=e[2]?.startsWith("native"),i=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let s,o;if(i){const c=ye.exec(r);if(c){const a=Ae.exec(c[1]);a?(e[2]=a[4]??a[1],e[3]=a[5]??a[2],e[4]=a[3]):c[2]&&(e[2]=c[1]),c[2]&&(s={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0,methodName:"eval",raw:r,type:"eval"})}else{const a=we.exec(r);a&&(o={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0},s={column:a[6]?+a[6]:void 0,file:a[1],line:a[5]?+a[5]:void 0,methodName:"eval",raw:a[0],type:"eval"})}}const[n,l]=B(e[1]?e[1].replace(C,"<anonymous>"):y,e[2]),d={column:e[4]?+e[4]:void 0,evalOrigin:s,file:l,line:e[3]?+e[3]:void 0,methodName:n,raw:r,type:i?"eval":t?"native":void 0};return o?(d.column=o.column,d.file=o.file,d.line=o.line):W(d,`${l}:${e[3]}:${e[4]}`),d}},"parseChromium"),We=v((r,e)=>{const t=Ee.exec(r);if(t){b(`parse gecko error stack line: "${r}"`,`found: ${JSON.stringify(t)}`);const i=t[3]?.includes(" > eval"),s=i&&t[3]&&je.exec(t[3]);let o;i&&s&&(t[3]=s[1],o={column:t[5]?+t[5]:void 0,file:t[3],line:t[4]?+t[4]:void 0,methodName:"eval",raw:r,type:"eval"},t[4]=s[2]);const[n,l]=B(t[1]?t[1].replace(C,"<anonymous>"):y,t[3]);let d;(e?.type==="safari"||!i&&e?.type==="firefox")&&e.column?d=e.column:!i&&t[5]&&(d=+t[5]);let c;return(e?.type==="safari"||!i&&e?.type==="firefox")&&e.line?c=e.line:t[4]&&(c=+t[4]),{column:d,evalOrigin:o,file:l,line:c,methodName:n,raw:r,type:i?"eval":l.includes("[native code]")?"native":void 0}}},"parseGecko"),Ge=v((r,e)=>{const t=Oe.exec(r);if(!(t&&t[2].includes(" > eval"))&&t)return b(`parse firefox error stack line: "${r}"`,`found: ${JSON.stringify(t)}`),{column:t[4]?+t[4]:e?.column??void 0,file:t[2],line:t[3]?+t[3]:e?.line??void 0,methodName:t[1]||y,raw:r,type:void 0}},"parseFirefox"),Re=v(r=>{const e=ke.exec(r);if(e)return b(`parse react android native error stack line: "${r}"`,`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:y,raw:r,type:void 0}},"parseReactAndroidNative"),G=v((r,{filter:e,frameLimit:t=50}={})=>{const i=r;let s=(typeof i.stacktrace=="string"?i.stacktrace:r.stack??"").split(`
|
|
7
|
+
`).map(o=>(T.test(o)?o.replace(T,"$1"):o).trim()).filter(o=>!Me.test(o)&&o!=="eval code");return e&&(s=s.filter(o=>e(o))),s=s.slice(0,t),s.reduce((o,n,l)=>{if(!n||n.length>1024)return o;let d;if(Pe.test(n))d=Ce(n);else if(_e.test(n))d=Be(n);else if(Te.test(n)){let c;if(l===0){const a=r,p=a.columnNumber,g=a.lineNumber,m=a.line,u=a.column;p||g?c={column:p,line:g,type:"firefox"}:(m||u)&&(c={column:u,line:m,type:"safari"})}d=Ge(n,c)??We(n,c)}else d=Re(n);return d?o.push(d):b(`parse error stack line: "${n}"`,"not parser found"),o},[])},"parseStacktrace");var Ve=Object.defineProperty,Fe=N((r,e)=>Ve(r,"name",{value:e,configurable:!0}),"p"),Ie=Object.defineProperty,R=Fe((r,e)=>Ie(r,"name",{value:e,configurable:!0}),"m");const Je=ee(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=R(r=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[e,t]=x.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return x.getBuiltinModule(r)}return Je(r)},"__cjs_getBuiltinModule"),{existsSync:qe,readFileSync:ze}=A("node:fs"),{relative:De}=A("node:path"),{cwd:Ue}=x,{fileURLToPath:He}=A("node:url");var Ke=Object.defineProperty,f=R((r,e)=>Ke(r,"name",{value:e,configurable:!0}),"o");const w=f((r,e,t)=>t===0?r:e===" "?r+" ".repeat(t):r+" ".repeat(e*t),"getPrefix"),Qe=f((r,e)=>{const t=r.replace("async file:","file:");return De(e,t.startsWith("file:")?He(t):t)},"getRelativePath"),Ye=f((r,e,t)=>{if(e)return t.title(r.message);const i=r.message?`: ${r.message}`:"";return t.title(r.name+i)},"getTitleText"),V=f((r,{color:e,hideErrorTitle:t,indentation:i,prefix:s},o)=>`${w(s,i,o)}${Ye(r,t,e)}
|
|
8
|
+
`,"getMessage"),F=f((r,{color:e,indentation:t,prefix:i},s)=>{if(r.hint===void 0)return;const o=w(i,t,s);let n="";if(Array.isArray(r.hint))for(const l of r.hint)n+=`${o+l}
|
|
9
|
+
`;else n+=o+r.hint;return e.hint(n)},"getHint"),M=f((r,{color:e,cwd:t,displayShortPath:i,indentation:s,prefix:o},n=0)=>{const l=i?Qe(r.file,t):r.file,{fileLine:d,method:c}=e;return`${w(o,s,n)}at ${r.methodName?`${c(r.methodName)} `:""}${d(l)}:${d(r.line?.toString()??"")}`},"getMainFrame"),I=f((r,{color:e,indentation:t,linesAbove:i,linesBelow:s,prefix:o,showGutter:n,showLineNumbers:l,tabWidth:d},c)=>{if(r.file===void 0)return;const a=r.file.replace("file://","");if(!qe(a))return;const p=ze(a,"utf8");return me(p,{start:{column:r.column,line:r.line}},{color:e,linesAbove:i,linesBelow:s,prefix:w(o,t,c),showGutter:n,showLineNumbers:l,tabWidth:d})},"getCode"),J=f((r,e,t)=>{if(r.errors.length===0)return;let i=`${w(e.prefix,e.indentation,t)}Errors:
|
|
10
|
+
|
|
11
|
+
`,s=!0;for(const o of r.errors)s?s=!1:i+=`
|
|
12
|
+
|
|
13
|
+
`,i+=z(o,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},t+1);return`
|
|
14
|
+
${i}`},"getErrors"),q=f((r,e,t)=>{let i=`${w(e.prefix,e.indentation,t)}Caused by:
|
|
15
|
+
|
|
16
|
+
`;const s=r.cause;i+=V(s,e,t);const o=G(s).shift(),n=F(s,e,t);if(n&&(i+=`${n}
|
|
17
|
+
`),o&&(i+=M(o,e,t),!e.hideErrorCauseCodeView)){const l=I(o,e,t);l!==void 0&&(i+=`
|
|
18
|
+
${l}`)}if(s.cause)i+=`
|
|
19
|
+
${q(s,e,t+1)}`;else if(s instanceof AggregateError){const l=J(s,e,t);l!==void 0&&(i+=`
|
|
20
|
+
${l}`)}return`
|
|
21
|
+
${i}`},"getCause"),Xe=f((r,e)=>(r.length>0?`
|
|
22
|
+
`:"")+r.map(t=>M(t,e)).join(`
|
|
23
|
+
`),"getStacktrace"),z=f((r,e,t)=>{const i={cwd:Ue(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:f(n=>n,"fileLine"),gutter:f(n=>n,"gutter"),hint:f(n=>n,"hint"),marker:f(n=>n,"marker"),message:f(n=>n,"message"),method:f(n=>n,"method"),title:f(n=>n,"title"),...e.color}},s=G(r,{filter:e.filterStacktrace,frameLimit:i.framesMaxLimit}),o=s.shift();return[e.hideMessage?void 0:V(r,i,t),F(r,i,t),o?M(o,i,t):void 0,o&&!i.hideErrorCodeView?I(o,i,t):void 0,r instanceof AggregateError?J(r,i,t):void 0,r.cause===void 0?void 0:q(r,i,t),s.length>0?Xe(s,i):void 0].filter(Boolean).join(`
|
|
24
|
+
`).replaceAll("\\","/")},"internalRenderError"),rr=f((r,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return z(r,e,0)},"renderError");export{rr as G,me as N,G as Q,fe as k};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { O as Options$1 } from "../packem_shared/index.d-Br8HpP0A.js";
|
|
2
|
-
import { P as Plugin } from "../packem_shared/plugin-manager.d-
|
|
2
|
+
import { P as Plugin } from "../packem_shared/plugin-manager.d-Dz-wu1tI.js";
|
|
3
3
|
import '@visulima/tabular';
|
|
4
4
|
type ErrorHandlerOptions = {
|
|
5
5
|
/** Show detailed error information including stack traces and code frames (default: false) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var n=(e,r)=>u(e,"name",{value:r,configurable:!0});import{G as h}from"../packem_shared/renderError-
|
|
1
|
+
var u=Object.defineProperty;var n=(e,r)=>u(e,"name",{value:r,configurable:!0});import{G as h}from"../packem_shared/renderError-DxgI44AK-DFDWFoCr.js";import{e as p}from"../packem_shared/runtime-process-DKHFvYkv.js";var E=Object.defineProperty,a=n((e,r)=>E(e,"name",{value:r,configurable:!0}),"n");const P=a((e={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:a((r,t)=>{const{logger:o,runtime:l}=t,{detailed:s=!1,exitOnError:d=!0,formatter:i,logErrors:f=!0,renderOptions:g={}}=e;if(f)if(i)o.error(i(r));else if(s){const c=l.getCwd(),m=h(r,{cwd:c,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...g});o.error(m)}else o.error(r);d&&p(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");export{P as errorHandlerPlugin};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/cerebro",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.27",
|
|
4
4
|
"description": "A delightful toolkit for building cross-runtime CLIs for Node.js, Deno, and Bun.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ansi",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"@bomb.sh/tab": "0.0.15",
|
|
122
122
|
"@visulima/boxen": "3.0.0-alpha.10",
|
|
123
123
|
"@visulima/find-cache-dir": "3.0.0-alpha.9",
|
|
124
|
-
"@visulima/pail": "4.0.0-alpha.
|
|
124
|
+
"@visulima/pail": "4.0.0-alpha.17",
|
|
125
125
|
"github-slugger": "2.0.0"
|
|
126
126
|
},
|
|
127
127
|
"peerDependenciesMeta": {
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var N=(r,e)=>Q(r,"name",{value:e,configurable:!0});import{createRequire as X}from"node:module";const Y=X(import.meta.url),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Z=N(r=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[e,t]=S.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return S.getBuiltinModule(r)}return Y(r)},"__cjs_getBuiltinModule"),{createRequire:ee}=Z("node:module");var re=Object.defineProperty,te=N((r,e)=>re(r,"name",{value:e,configurable:!0}),"A$2"),ie=Object.defineProperty,A=te((r,e)=>ie(r,"name",{value:e,configurable:!0}),"$"),ne=Object.defineProperty,oe=A((r,e)=>ne(r,"name",{value:e,configurable:!0}),"r$1");const se=oe(r=>r.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
-
`),"normalizeLF"),ae=globalThis.process??Object.create(null),P={versions:{}},T=new Proxy(ae,{get(r,e){if(e in r)return r[e];if(e in P)return P[e]}});var le=Object.defineProperty,ce=A((r,e)=>le(r,"name",{value:e,configurable:!0}),"b");const de=ce((r,e,t,i)=>{const s={column:0,line:-1,...r.start},o={...s,...r.end},n=s.line,l=s.column,d=o.line,c=o.column;let a=Math.max(n-(t+1),0),p=Math.min(e.length,d+i);n===-1&&(a=0),d===-1&&(p=e.length);const g=d-n,m={};if(g)for(let u=0;u<=g;u++){const $=u+n;if(!l)m[$]=!0;else if(u===0){const h=e[$-1]?.length;m[$]=[l,(h??0)-l+1]}else if(u===g)m[$]=[0,c];else{const h=e[$-u]?.length;m[$]=[0,h]}}else l===c?m[n]=l?[l,0]:!0:m[n]=[l,(c??0)-(l??0)];return{end:p,markerLines:m,start:a}},"getMarkerLines");var ue=Object.defineProperty,E=A((r,e)=>ue(r,"name",{value:e,configurable:!0}),"t");const fe=T.platform==="win32"&&!T.env?.WT_SESSION?">":"❯",me=E((r,e,t)=>{const i={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...t,color:{gutter:E(u=>u,"gutter"),marker:E(u=>u,"marker"),message:E(u=>u,"message"),...t?.color}},s=typeof e.start.column=="number";let o=se(r).split(`
|
|
3
|
-
`);typeof i.tabWidth=="number"&&(o=o.map(u=>u.replaceAll(" "," ".repeat(i.tabWidth))));const{end:n,markerLines:l,start:d}=de(e,o,i.linesAbove,i.linesBelow),c=String(n).length,{gutter:a,marker:p,message:g}=i.color;let m=o.slice(d,n).map((u,$)=>{const h=d+1+$,k=l[h],D=` ${String(h)}`.slice(-c),U=!l[h+1],j=` ${D}${i.showGutter?" |":""}`;if(k){let O="";if(Array.isArray(k)){const H=u.replaceAll(/[^\t]/g," ").slice(0,Math.max(k[0]-1,0)),K=k[1]||1;O=[`
|
|
4
|
-
`,i.prefix+a(j.replaceAll(/\d/g," "))," ",H,p("^").repeat(K)].join(""),U&&i.message&&(O+=` ${g(i.message)}`)}return[i.prefix+p(fe),a(j),u.length>0?` ${u}`:"",O].join("")}return`${i.prefix} ${a(j)}${u.length>0?` ${u}`:""}`}).join(`
|
|
5
|
-
`);return i.message&&!s&&(m=`${i.prefix+" ".repeat(c+1)+i.message}
|
|
6
|
-
${m}`),m},"codeFrame");var pe=Object.defineProperty,ve=N((r,e)=>pe(r,"name",{value:e,configurable:!0}),"x$1"),ge=Object.defineProperty,$e=ve((r,e)=>ge(r,"name",{value:e,configurable:!0}),"x"),he=Object.defineProperty,v=$e((r,e)=>he(r,"name",{value:e,configurable:!0}),"u");const b=v((r,...e)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${r}`,...e)},"debugLog"),y="<unknown>",be=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ye=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,xe=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,we=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Ne=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Se=/in\s(.*)\s\(at\s(.+)\)\sat/,ke=/^(?:.*@)?(.*):(\d+):(\d+)$/,Ee=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,je=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Oe=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,_=/\(error: (.*)\)/,Ae=/at\s/,Le=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Me=/^\s+|\s+$/g,Pe=/\S*(?:Error: |AggregateError:)/,C=/^Anonymous function$/,Te=/^\s*in\s.*/,_e=/^.*?\s*at\s.*/,Ce=/^.*?\s*@.*|\[native code\]/,B=v((r,e)=>{const t=r.includes("safari-extension"),i=r.includes("safari-web-extension");return t||i?[r.includes("@")?r.split("@")[0]:y,t?`safari-extension:${e}`:`safari-web-extension:${e}`]:[r,e]},"extractSafariExtensionDetails"),W=v((r,e)=>{const t=xe.exec(e);t&&(r.file=t[1],r.line=+t[2],r.column=+t[3])},"parseMapped"),Be=v(r=>{const e=Se.exec(r);if(e){b(`parse nested node error stack line: "${r}"`,`found: ${JSON.stringify(e)}`);const i=e[2].split(":");return{column:i[2]?+i[2]:void 0,file:i[0],line:i[1]?+i[1]:void 0,methodName:e[1]??y,raw:r,type:void 0}}const t=Ne.exec(r);if(t){b(`parse node error stack line: "${r}"`,`found: ${JSON.stringify(t)}`);const i={column:t[4]?+t[4]:void 0,file:t[2]?t[2].replace(Ae,""):void 0,line:t[3]?+t[3]:void 0,methodName:t[1]??y,raw:r,type:r.startsWith("internal")?"internal":void 0};return W(i,`${t[2]}:${t[3]}:${t[4]}`),i}},"parseNode"),We=v(r=>{const e=be.exec(r);if(e){b(`parse chrome error stack line: "${r}"`,`found: ${JSON.stringify(e)}`);const t=e[2]?.startsWith("native"),i=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let s,o;if(i){const c=ye.exec(r);if(c){const a=Le.exec(c[1]);a?(e[2]=a[4]??a[1],e[3]=a[5]??a[2],e[4]=a[3]):c[2]&&(e[2]=c[1]),c[2]&&(s={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0,methodName:"eval",raw:r,type:"eval"})}else{const a=we.exec(r);a&&(o={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0},s={column:a[6]?+a[6]:void 0,file:a[1],line:a[5]?+a[5]:void 0,methodName:"eval",raw:a[0],type:"eval"})}}const[n,l]=B(e[1]?e[1].replace(C,"<anonymous>"):y,e[2]),d={column:e[4]?+e[4]:void 0,evalOrigin:s,file:l,line:e[3]?+e[3]:void 0,methodName:n,raw:r,type:i?"eval":t?"native":void 0};return o?(d.column=o.column,d.file=o.file,d.line=o.line):W(d,`${l}:${e[3]}:${e[4]}`),d}},"parseChromium"),Ge=v((r,e)=>{const t=Ee.exec(r);if(t){b(`parse gecko error stack line: "${r}"`,`found: ${JSON.stringify(t)}`);const i=t[3]?.includes(" > eval"),s=i&&t[3]&&je.exec(t[3]);let o;i&&s&&(t[3]=s[1],o={column:t[5]?+t[5]:void 0,file:t[3],line:t[4]?+t[4]:void 0,methodName:"eval",raw:r,type:"eval"},t[4]=s[2]);const[n,l]=B(t[1]?t[1].replace(C,"<anonymous>"):y,t[3]);let d;(e?.type==="safari"||!i&&e?.type==="firefox")&&e.column?d=e.column:!i&&t[5]&&(d=+t[5]);let c;return(e?.type==="safari"||!i&&e?.type==="firefox")&&e.line?c=e.line:t[4]&&(c=+t[4]),{column:d,evalOrigin:o,file:l,line:c,methodName:n,raw:r,type:i?"eval":l.includes("[native code]")?"native":void 0}}},"parseGecko"),Re=v((r,e)=>{const t=Oe.exec(r);if(!(t&&t[2].includes(" > eval"))&&t)return b(`parse firefox error stack line: "${r}"`,`found: ${JSON.stringify(t)}`),{column:t[4]?+t[4]:e?.column??void 0,file:t[2],line:t[3]?+t[3]:e?.line??void 0,methodName:t[1]||y,raw:r,type:void 0}},"parseFirefox"),Fe=v(r=>{const e=ke.exec(r);if(e)return b(`parse react android native error stack line: "${r}"`,`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:y,raw:r,type:void 0}},"parseReactAndroidNative"),G=v((r,{filter:e,frameLimit:t=50}={})=>{const i=r;let s=(typeof i.stacktrace=="string"?i.stacktrace:r.stack??"").split(`
|
|
7
|
-
`).map(o=>(_.test(o)?o.replace(_,"$1"):o).replaceAll(Me,"")).filter(o=>!Pe.test(o)&&o!=="eval code");return e&&(s=s.filter(o=>e(o))),s=s.slice(0,t),s.reduce((o,n,l)=>{if(!n||n.length>1024)return o;let d;if(Te.test(n))d=Be(n);else if(_e.test(n))d=We(n);else if(Ce.test(n)){let c;if(l===0){const a=r,p=a.columnNumber,g=a.lineNumber,m=a.line,u=a.column;p||g?c={column:p,line:g,type:"firefox"}:(m||u)&&(c={column:u,line:m,type:"safari"})}d=Re(n,c)??Ge(n,c)}else d=Fe(n);return d?o.push(d):b(`parse error stack line: "${n}"`,"not parser found"),o},[])},"parseStacktrace");var Ie=Object.defineProperty,Ve=N((r,e)=>Ie(r,"name",{value:e,configurable:!0}),"p"),Je=Object.defineProperty,R=Ve((r,e)=>Je(r,"name",{value:e,configurable:!0}),"m");const qe=ee(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,L=R(r=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[e,t]=x.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return x.getBuiltinModule(r)}return qe(r)},"__cjs_getBuiltinModule"),{existsSync:ze,readFileSync:De}=L("node:fs"),{relative:Ue}=L("node:path"),{cwd:He}=x,{fileURLToPath:Ke}=L("node:url");var Qe=Object.defineProperty,f=R((r,e)=>Qe(r,"name",{value:e,configurable:!0}),"o");const w=f((r,e,t)=>t===0?r:e===" "?r+" ".repeat(t):r+" ".repeat(e*t),"getPrefix"),Xe=f((r,e)=>{const t=r.replace("async file:","file:");return Ue(e,t.startsWith("file:")?Ke(t):t)},"getRelativePath"),Ye=f((r,e,t)=>{if(e)return t.title(r.message);const i=r.message?`: ${r.message}`:"";return t.title(r.name+i)},"getTitleText"),F=f((r,{color:e,hideErrorTitle:t,indentation:i,prefix:s},o)=>`${w(s,i,o)}${Ye(r,t,e)}
|
|
8
|
-
`,"getMessage"),I=f((r,{color:e,indentation:t,prefix:i},s)=>{if(r.hint===void 0)return;const o=w(i,t,s);let n="";if(Array.isArray(r.hint))for(const l of r.hint)n+=`${o+l}
|
|
9
|
-
`;else n+=o+r.hint;return e.hint(n)},"getHint"),M=f((r,{color:e,cwd:t,displayShortPath:i,indentation:s,prefix:o},n=0)=>{const l=i?Xe(r.file,t):r.file,{fileLine:d,method:c}=e;return`${w(o,s,n)}at ${r.methodName?`${c(r.methodName)} `:""}${d(l)}:${d(r.line?.toString()??"")}`},"getMainFrame"),V=f((r,{color:e,indentation:t,linesAbove:i,linesBelow:s,prefix:o,showGutter:n,showLineNumbers:l,tabWidth:d},c)=>{if(r.file===void 0)return;const a=r.file.replace("file://","");if(!ze(a))return;const p=De(a,"utf8");return me(p,{start:{column:r.column,line:r.line}},{color:e,linesAbove:i,linesBelow:s,prefix:w(o,t,c),showGutter:n,showLineNumbers:l,tabWidth:d})},"getCode"),J=f((r,e,t)=>{if(r.errors.length===0)return;let i=`${w(e.prefix,e.indentation,t)}Errors:
|
|
10
|
-
|
|
11
|
-
`,s=!0;for(const o of r.errors)s?s=!1:i+=`
|
|
12
|
-
|
|
13
|
-
`,i+=z(o,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},t+1);return`
|
|
14
|
-
${i}`},"getErrors"),q=f((r,e,t)=>{let i=`${w(e.prefix,e.indentation,t)}Caused by:
|
|
15
|
-
|
|
16
|
-
`;const s=r.cause;i+=F(s,e,t);const o=G(s).shift(),n=I(s,e,t);if(n&&(i+=`${n}
|
|
17
|
-
`),o&&(i+=M(o,e,t),!e.hideErrorCauseCodeView)){const l=V(o,e,t);l!==void 0&&(i+=`
|
|
18
|
-
${l}`)}if(s.cause)i+=`
|
|
19
|
-
${q(s,e,t+1)}`;else if(s instanceof AggregateError){const l=J(s,e,t);l!==void 0&&(i+=`
|
|
20
|
-
${l}`)}return`
|
|
21
|
-
${i}`},"getCause"),Ze=f((r,e)=>(r.length>0?`
|
|
22
|
-
`:"")+r.map(t=>M(t,e)).join(`
|
|
23
|
-
`),"getStacktrace"),z=f((r,e,t)=>{const i={cwd:He(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:f(n=>n,"fileLine"),gutter:f(n=>n,"gutter"),hint:f(n=>n,"hint"),marker:f(n=>n,"marker"),message:f(n=>n,"message"),method:f(n=>n,"method"),title:f(n=>n,"title"),...e.color}},s=G(r,{filter:e.filterStacktrace,frameLimit:i.framesMaxLimit}),o=s.shift();return[e.hideMessage?void 0:F(r,i,t),I(r,i,t),o?M(o,i,t):void 0,o&&!i.hideErrorCodeView?V(o,i,t):void 0,r instanceof AggregateError?J(r,i,t):void 0,r.cause===void 0?void 0:q(r,i,t),s.length>0?Ze(s,i):void 0].filter(Boolean).join(`
|
|
24
|
-
`).replaceAll("\\","/")},"internalRenderError"),tr=f((r,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return z(r,e,0)},"renderError");export{tr as G,me as N,G as Q,fe as k};
|