@cherrypeak-org/cherryboard-web 1.0.1 → 1.0.3
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 +21 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.mjs +1 -1
- package/package.json +3 -3
- /package/{bin → cli}/cherryboard-upload-sourcemaps.mjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
All notable changes to `@cherrypeak-org/cherryboard-web` are documented here.
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## [1.0.3]
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
- **The `cherryboard-upload-sourcemaps` CLI is actually included.** It lived in
|
|
10
|
+
`bin/`, which this repository's .NET `.gitignore` excludes as build output, so
|
|
11
|
+
it was never committed and never shipped — `npx cherryboard-upload-sourcemaps`
|
|
12
|
+
failed on every published version. Moved to `cli/`, since in this repository
|
|
13
|
+
`bin` unambiguously means build output and a source directory of that name
|
|
14
|
+
will keep being swallowed.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## [1.0.2]
|
|
19
|
+
|
|
20
|
+
First release published by CI rather than from a developer's machine. No
|
|
21
|
+
functional change — the point is that releases now come from a verified build
|
|
22
|
+
of the committed source, which is what would have prevented 1.0.0 shipping a
|
|
23
|
+
stale local build with source maps in it.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
6
27
|
## [1.0.1]
|
|
7
28
|
|
|
8
29
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var v="1.0.
|
|
1
|
+
'use strict';var v="1.0.3";function d(){return typeof window<"u"&&typeof document<"u"}function p(){return new Date().toISOString()}function a(t,e){return e<=0?"":t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function E(t,e=24e3){let r=new WeakSet;try{let n=JSON.stringify(t,(s,i)=>{if(i instanceof Error)return {name:i.name,message:i.message,stack:i.stack};if(typeof i=="object"&&i!==null){if(r.has(i))return "[Circular]";r.add(i);}if(typeof i=="bigint")return i.toString();if(typeof i!="function")return i});return n===void 0||n.length>e?void 0:n}catch{return}}function k(t,e){return !t||e.length===0?false:e.some(r=>typeof r=="string"?t.includes(r):r.test(t))}function A(t){let e=t.replace(/\/+$/,"");return `${/\/api\/v\d+$/.test(e)?e:`${e}/api/v1`}/errors/batch`}var h=class{constructor(e){this.max=e;this.items=[];this.teardown=[];}add(e){this.items.push({timestamp:e.timestamp??p(),category:e.category,message:a(e.message,500),level:e.level,data:e.data}),this.items.length>this.max&&this.items.shift();}snapshot(){return this.items.slice()}install(){d()&&(this.installHistory(),this.installClicks(),this.installFetch());}installHistory(){try{let e=window.history,r=s=>{let i=e[s];if(typeof i!="function")return ()=>{};let o=(...l)=>{try{let u=l[2];typeof u=="string"&&this.add({category:"navigation",message:`${s} \u2192 ${u}`});}catch{}return i.apply(window.history,l)};return e[s]=o,()=>{e[s]===o&&(e[s]=i);}};this.teardown.push(r("pushState"),r("replaceState"));let n=()=>this.add({category:"navigation",message:`popstate \u2192 ${location.pathname}`});window.addEventListener("popstate",n),this.teardown.push(()=>window.removeEventListener("popstate",n));}catch{}}installClicks(){try{let e=r=>{let n=r.target;if(!n||typeof n.tagName!="string")return;let s=n.id?`#${n.id}`:"",i=typeof n.className=="string"?n.className:"",o=i?`.${i.split(/\s+/).filter(Boolean).slice(0,2).join(".")}`:"";this.add({category:"click",message:`${n.tagName.toLowerCase()}${s}${o}`});};window.addEventListener("click",e,{capture:!0,passive:!0}),this.teardown.push(()=>window.removeEventListener("click",e,{capture:!0}));}catch{}}installFetch(){try{let e=window.fetch;if(typeof e!="function")return;let r=(...n)=>{let[s,i]=n,o=i?.method??(typeof s=="object"&&s&&"method"in s?s.method:"GET"),l=typeof s=="string"?s:s instanceof URL?s.href:s.url;return e.apply(window,n).then(u=>(this.add({category:"fetch",message:`${o} ${l} \u2192 ${u.status}`,level:u.ok?void 0:"Warning"}),u),u=>{throw this.add({category:"fetch",message:`${o} ${l} \u2192 failed`,level:"Warning"}),u})};window.fetch=r,this.teardown.push(()=>{window.fetch===r&&(window.fetch=e);});}catch{}}close(){for(let e of this.teardown.splice(0))try{e();}catch{}}};var m=class{constructor(e=4e3,r=100){this.windowMs=e;this.max=r;this.seen=new Map;}shouldSend(e){let r=Date.now(),n=this.seen.get(e);if(n!==void 0&&r-n<this.windowMs)return false;if(this.seen.set(e,r),this.seen.size>this.max){let s=this.seen.keys().next().value;s!==void 0&&this.seen.delete(s);}return true}};function I(t,e){let r=(e??"").split(`
|
|
2
2
|
`).slice(0,4).map(n=>n.replace(/:\d+:\d+/g,"").replace(/\?[^\s)]*/g,"").replace(/https?:\/\/[^/]+/g,"").trim()).join("|");return `${t}::${r}`.slice(0,500)}function M(t){if(!d())return ()=>{};let e=t.config,r=[];if(e.captureUnhandledErrors||e.captureResourceErrors){let n=s=>{try{let i=s.target;if(i instanceof HTMLElement){if(!e.captureResourceErrors)return;let l=i,u=l.src||l.href;if(!u)return;t.captureMessage(`Resource failed to load: ${u}`,"Warning",{context:{resource:i.tagName.toLowerCase(),url:u}});return}if(!e.captureUnhandledErrors)return;let o=s;if(!o.error&&(!o.message||o.message==="Script error."))return;t.captureException(o.error??o.message);}catch{}};window.addEventListener("error",n,true),r.push(()=>window.removeEventListener("error",n,true));}if(e.captureUnhandledRejections){let n=s=>{try{t.captureException(s.reason??"Unhandled promise rejection",{context:{unhandledRejection:!0}});}catch{}};window.addEventListener("unhandledrejection",n),r.push(()=>window.removeEventListener("unhandledrejection",n));}if(e.captureConsole){let n=console;for(let s of ["error","warn"]){let i=n[s];if(typeof i!="function")continue;let o=(...l)=>{try{t.addBreadcrumb({category:"console",level:s==="error"?"Error":"Warning",message:l.map(D).join(" ").slice(0,500)});}catch{}return i.apply(console,l)};n[s]=o,r.push(()=>{n[s]===o&&(n[s]=i);});}}return ()=>{for(let n of r.splice(0))try{n();}catch{}}}function D(t){if(typeof t=="string")return t;if(t instanceof Error)return `${t.name}: ${t.message}`;try{return JSON.stringify(t)??String(t)}catch{return String(t)}}var g=2e3,S=8e3,C=4e3;function _(t){if(t instanceof Error)return {message:a(t.message||t.name||"Error",g),exceptionType:t.name||"Error",stackTrace:t.stack?a(t.stack,S):void 0,innerException:R(t.cause)};if(typeof t=="string")return {message:a(t,g),exceptionType:"Error"};if(t&&typeof t=="object"){let e=t,r=typeof e.message=="string"?e.message:N(e)??Object.prototype.toString.call(t),n=typeof e.name=="string"?e.name:"Error",s=typeof e.stack=="string"?e.stack:void 0;return {message:a(r,g),exceptionType:n,stackTrace:s?a(s,S):void 0,innerException:R(e.cause)}}return {message:a(String(t),g),exceptionType:"Error"}}function j(t){if(t.stackTrace)return t;try{let e=new Error(t.message).stack;if(e){let r=e.split(`
|
|
3
3
|
`).slice(2).join(`
|
|
4
4
|
`);return {...t,stackTrace:a(r||e,S)}}}catch{}return t}function R(t){if(t==null)return;if(t instanceof Error){let r=[`${t.name}: ${t.message}`];t.stack&&r.push(t.stack);let n=R(t.cause);return n&&r.push(`Caused by: ${n}`),a(r.join(`
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** SDK version — kept in sync with package.json. */
|
|
2
|
-
declare const SDK_VERSION = "1.0.
|
|
2
|
+
declare const SDK_VERSION = "1.0.3";
|
|
3
3
|
/** Severity levels — these strings match the backend `ErrorSeverity` enum exactly. */
|
|
4
4
|
type Severity = 'Debug' | 'Info' | 'Warning' | 'Error' | 'Critical';
|
|
5
5
|
/** A trail entry giving context that led up to an error. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** SDK version — kept in sync with package.json. */
|
|
2
|
-
declare const SDK_VERSION = "1.0.
|
|
2
|
+
declare const SDK_VERSION = "1.0.3";
|
|
3
3
|
/** Severity levels — these strings match the backend `ErrorSeverity` enum exactly. */
|
|
4
4
|
type Severity = 'Debug' | 'Info' | 'Warning' | 'Error' | 'Critical';
|
|
5
5
|
/** A trail entry giving context that led up to an error. */
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var v="1.0.
|
|
1
|
+
var v="1.0.3";function d(){return typeof window<"u"&&typeof document<"u"}function p(){return new Date().toISOString()}function a(t,e){return e<=0?"":t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function E(t,e=24e3){let r=new WeakSet;try{let n=JSON.stringify(t,(s,i)=>{if(i instanceof Error)return {name:i.name,message:i.message,stack:i.stack};if(typeof i=="object"&&i!==null){if(r.has(i))return "[Circular]";r.add(i);}if(typeof i=="bigint")return i.toString();if(typeof i!="function")return i});return n===void 0||n.length>e?void 0:n}catch{return}}function k(t,e){return !t||e.length===0?false:e.some(r=>typeof r=="string"?t.includes(r):r.test(t))}function A(t){let e=t.replace(/\/+$/,"");return `${/\/api\/v\d+$/.test(e)?e:`${e}/api/v1`}/errors/batch`}var h=class{constructor(e){this.max=e;this.items=[];this.teardown=[];}add(e){this.items.push({timestamp:e.timestamp??p(),category:e.category,message:a(e.message,500),level:e.level,data:e.data}),this.items.length>this.max&&this.items.shift();}snapshot(){return this.items.slice()}install(){d()&&(this.installHistory(),this.installClicks(),this.installFetch());}installHistory(){try{let e=window.history,r=s=>{let i=e[s];if(typeof i!="function")return ()=>{};let o=(...l)=>{try{let u=l[2];typeof u=="string"&&this.add({category:"navigation",message:`${s} \u2192 ${u}`});}catch{}return i.apply(window.history,l)};return e[s]=o,()=>{e[s]===o&&(e[s]=i);}};this.teardown.push(r("pushState"),r("replaceState"));let n=()=>this.add({category:"navigation",message:`popstate \u2192 ${location.pathname}`});window.addEventListener("popstate",n),this.teardown.push(()=>window.removeEventListener("popstate",n));}catch{}}installClicks(){try{let e=r=>{let n=r.target;if(!n||typeof n.tagName!="string")return;let s=n.id?`#${n.id}`:"",i=typeof n.className=="string"?n.className:"",o=i?`.${i.split(/\s+/).filter(Boolean).slice(0,2).join(".")}`:"";this.add({category:"click",message:`${n.tagName.toLowerCase()}${s}${o}`});};window.addEventListener("click",e,{capture:!0,passive:!0}),this.teardown.push(()=>window.removeEventListener("click",e,{capture:!0}));}catch{}}installFetch(){try{let e=window.fetch;if(typeof e!="function")return;let r=(...n)=>{let[s,i]=n,o=i?.method??(typeof s=="object"&&s&&"method"in s?s.method:"GET"),l=typeof s=="string"?s:s instanceof URL?s.href:s.url;return e.apply(window,n).then(u=>(this.add({category:"fetch",message:`${o} ${l} \u2192 ${u.status}`,level:u.ok?void 0:"Warning"}),u),u=>{throw this.add({category:"fetch",message:`${o} ${l} \u2192 failed`,level:"Warning"}),u})};window.fetch=r,this.teardown.push(()=>{window.fetch===r&&(window.fetch=e);});}catch{}}close(){for(let e of this.teardown.splice(0))try{e();}catch{}}};var m=class{constructor(e=4e3,r=100){this.windowMs=e;this.max=r;this.seen=new Map;}shouldSend(e){let r=Date.now(),n=this.seen.get(e);if(n!==void 0&&r-n<this.windowMs)return false;if(this.seen.set(e,r),this.seen.size>this.max){let s=this.seen.keys().next().value;s!==void 0&&this.seen.delete(s);}return true}};function I(t,e){let r=(e??"").split(`
|
|
2
2
|
`).slice(0,4).map(n=>n.replace(/:\d+:\d+/g,"").replace(/\?[^\s)]*/g,"").replace(/https?:\/\/[^/]+/g,"").trim()).join("|");return `${t}::${r}`.slice(0,500)}function M(t){if(!d())return ()=>{};let e=t.config,r=[];if(e.captureUnhandledErrors||e.captureResourceErrors){let n=s=>{try{let i=s.target;if(i instanceof HTMLElement){if(!e.captureResourceErrors)return;let l=i,u=l.src||l.href;if(!u)return;t.captureMessage(`Resource failed to load: ${u}`,"Warning",{context:{resource:i.tagName.toLowerCase(),url:u}});return}if(!e.captureUnhandledErrors)return;let o=s;if(!o.error&&(!o.message||o.message==="Script error."))return;t.captureException(o.error??o.message);}catch{}};window.addEventListener("error",n,true),r.push(()=>window.removeEventListener("error",n,true));}if(e.captureUnhandledRejections){let n=s=>{try{t.captureException(s.reason??"Unhandled promise rejection",{context:{unhandledRejection:!0}});}catch{}};window.addEventListener("unhandledrejection",n),r.push(()=>window.removeEventListener("unhandledrejection",n));}if(e.captureConsole){let n=console;for(let s of ["error","warn"]){let i=n[s];if(typeof i!="function")continue;let o=(...l)=>{try{t.addBreadcrumb({category:"console",level:s==="error"?"Error":"Warning",message:l.map(D).join(" ").slice(0,500)});}catch{}return i.apply(console,l)};n[s]=o,r.push(()=>{n[s]===o&&(n[s]=i);});}}return ()=>{for(let n of r.splice(0))try{n();}catch{}}}function D(t){if(typeof t=="string")return t;if(t instanceof Error)return `${t.name}: ${t.message}`;try{return JSON.stringify(t)??String(t)}catch{return String(t)}}var g=2e3,S=8e3,C=4e3;function _(t){if(t instanceof Error)return {message:a(t.message||t.name||"Error",g),exceptionType:t.name||"Error",stackTrace:t.stack?a(t.stack,S):void 0,innerException:R(t.cause)};if(typeof t=="string")return {message:a(t,g),exceptionType:"Error"};if(t&&typeof t=="object"){let e=t,r=typeof e.message=="string"?e.message:N(e)??Object.prototype.toString.call(t),n=typeof e.name=="string"?e.name:"Error",s=typeof e.stack=="string"?e.stack:void 0;return {message:a(r,g),exceptionType:n,stackTrace:s?a(s,S):void 0,innerException:R(e.cause)}}return {message:a(String(t),g),exceptionType:"Error"}}function j(t){if(t.stackTrace)return t;try{let e=new Error(t.message).stack;if(e){let r=e.split(`
|
|
3
3
|
`).slice(2).join(`
|
|
4
4
|
`);return {...t,stackTrace:a(r||e,S)}}}catch{}return t}function R(t){if(t==null)return;if(t instanceof Error){let r=[`${t.name}: ${t.message}`];t.stack&&r.push(t.stack);let n=R(t.cause);return n&&r.push(`Caused by: ${n}`),a(r.join(`
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var h="1.0.
|
|
2
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var h="1.0.3";function d(){return typeof window<"u"&&typeof document<"u"}function m(){return new Date().toISOString()}function a(r,e){return e<=0?"":r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function C(r,e=24e3){let t=new WeakSet;try{let n=JSON.stringify(r,(o,s)=>{if(s instanceof Error)return {name:s.name,message:s.message,stack:s.stack};if(typeof s=="object"&&s!==null){if(t.has(s))return "[Circular]";t.add(s);}if(typeof s=="bigint")return s.toString();if(typeof s!="function")return s});return n===void 0||n.length>e?void 0:n}catch{return}}function B(r,e){return !r||e.length===0?false:e.some(t=>typeof t=="string"?r.includes(t):t.test(r))}function _(r){let e=r.replace(/\/+$/,"");return `${/\/api\/v\d+$/.test(e)?e:`${e}/api/v1`}/errors/batch`}var g=class{constructor(e){this.max=e;this.items=[];this.teardown=[];}add(e){this.items.push({timestamp:e.timestamp??m(),category:e.category,message:a(e.message,500),level:e.level,data:e.data}),this.items.length>this.max&&this.items.shift();}snapshot(){return this.items.slice()}install(){d()&&(this.installHistory(),this.installClicks(),this.installFetch());}installHistory(){try{let e=window.history,t=o=>{let s=e[o];if(typeof s!="function")return ()=>{};let i=(...l)=>{try{let u=l[2];typeof u=="string"&&this.add({category:"navigation",message:`${o} \u2192 ${u}`});}catch{}return s.apply(window.history,l)};return e[o]=i,()=>{e[o]===i&&(e[o]=s);}};this.teardown.push(t("pushState"),t("replaceState"));let n=()=>this.add({category:"navigation",message:`popstate \u2192 ${location.pathname}`});window.addEventListener("popstate",n),this.teardown.push(()=>window.removeEventListener("popstate",n));}catch{}}installClicks(){try{let e=t=>{let n=t.target;if(!n||typeof n.tagName!="string")return;let o=n.id?`#${n.id}`:"",s=typeof n.className=="string"?n.className:"",i=s?`.${s.split(/\s+/).filter(Boolean).slice(0,2).join(".")}`:"";this.add({category:"click",message:`${n.tagName.toLowerCase()}${o}${i}`});};window.addEventListener("click",e,{capture:!0,passive:!0}),this.teardown.push(()=>window.removeEventListener("click",e,{capture:!0}));}catch{}}installFetch(){try{let e=window.fetch;if(typeof e!="function")return;let t=(...n)=>{let[o,s]=n,i=s?.method??(typeof o=="object"&&o&&"method"in o?o.method:"GET"),l=typeof o=="string"?o:o instanceof URL?o.href:o.url;return e.apply(window,n).then(u=>(this.add({category:"fetch",message:`${i} ${l} \u2192 ${u.status}`,level:u.ok?void 0:"Warning"}),u),u=>{throw this.add({category:"fetch",message:`${i} ${l} \u2192 failed`,level:"Warning"}),u})};window.fetch=t,this.teardown.push(()=>{window.fetch===t&&(window.fetch=e);});}catch{}}close(){for(let e of this.teardown.splice(0))try{e();}catch{}}};var y=class{constructor(e=4e3,t=100){this.windowMs=e;this.max=t;this.seen=new Map;}shouldSend(e){let t=Date.now(),n=this.seen.get(e);if(n!==void 0&&t-n<this.windowMs)return false;if(this.seen.set(e,t),this.seen.size>this.max){let o=this.seen.keys().next().value;o!==void 0&&this.seen.delete(o);}return true}};function D(r,e){let t=(e??"").split(`
|
|
3
3
|
`).slice(0,4).map(n=>n.replace(/:\d+:\d+/g,"").replace(/\?[^\s)]*/g,"").replace(/https?:\/\/[^/]+/g,"").trim()).join("|");return `${r}::${t}`.slice(0,500)}function j(r){if(!d())return ()=>{};let e=r.config,t=[];if(e.captureUnhandledErrors||e.captureResourceErrors){let n=o=>{try{let s=o.target;if(s instanceof HTMLElement){if(!e.captureResourceErrors)return;let l=s,u=l.src||l.href;if(!u)return;r.captureMessage(`Resource failed to load: ${u}`,"Warning",{context:{resource:s.tagName.toLowerCase(),url:u}});return}if(!e.captureUnhandledErrors)return;let i=o;if(!i.error&&(!i.message||i.message==="Script error."))return;r.captureException(i.error??i.message);}catch{}};window.addEventListener("error",n,true),t.push(()=>window.removeEventListener("error",n,true));}if(e.captureUnhandledRejections){let n=o=>{try{r.captureException(o.reason??"Unhandled promise rejection",{context:{unhandledRejection:!0}});}catch{}};window.addEventListener("unhandledrejection",n),t.push(()=>window.removeEventListener("unhandledrejection",n));}if(e.captureConsole){let n=console;for(let o of ["error","warn"]){let s=n[o];if(typeof s!="function")continue;let i=(...l)=>{try{r.addBreadcrumb({category:"console",level:o==="error"?"Error":"Warning",message:l.map(q).join(" ").slice(0,500)});}catch{}return s.apply(console,l)};n[o]=i,t.push(()=>{n[o]===i&&(n[o]=s);});}}return ()=>{for(let n of t.splice(0))try{n();}catch{}}}function q(r){if(typeof r=="string")return r;if(r instanceof Error)return `${r.name}: ${r.message}`;try{return JSON.stringify(r)??String(r)}catch{return String(r)}}var b=2e3,S=8e3,R=4e3;function $(r){if(r instanceof Error)return {message:a(r.message||r.name||"Error",b),exceptionType:r.name||"Error",stackTrace:r.stack?a(r.stack,S):void 0,innerException:P(r.cause)};if(typeof r=="string")return {message:a(r,b),exceptionType:"Error"};if(r&&typeof r=="object"){let e=r,t=typeof e.message=="string"?e.message:O(e)??Object.prototype.toString.call(r),n=typeof e.name=="string"?e.name:"Error",o=typeof e.stack=="string"?e.stack:void 0;return {message:a(t,b),exceptionType:n,stackTrace:o?a(o,S):void 0,innerException:P(e.cause)}}return {message:a(String(r),b),exceptionType:"Error"}}function L(r){if(r.stackTrace)return r;try{let e=new Error(r.message).stack;if(e){let t=e.split(`
|
|
4
4
|
`).slice(2).join(`
|
|
5
5
|
`);return {...r,stackTrace:a(t||e,S)}}}catch{}return r}function P(r){if(r==null)return;if(r instanceof Error){let t=[`${r.name}: ${r.message}`];r.stack&&t.push(r.stack);let n=P(r.cause);return n&&t.push(`Caused by: ${n}`),a(t.join(`
|
package/dist/react/index.d.cts
CHANGED
|
@@ -32,7 +32,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** SDK version — kept in sync with package.json. */
|
|
35
|
-
declare const SDK_VERSION = "1.0.
|
|
35
|
+
declare const SDK_VERSION = "1.0.3";
|
|
36
36
|
/** Severity levels — these strings match the backend `ErrorSeverity` enum exactly. */
|
|
37
37
|
type Severity = 'Debug' | 'Info' | 'Warning' | 'Error' | 'Critical';
|
|
38
38
|
/** A trail entry giving context that led up to an error. */
|
package/dist/react/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** SDK version — kept in sync with package.json. */
|
|
35
|
-
declare const SDK_VERSION = "1.0.
|
|
35
|
+
declare const SDK_VERSION = "1.0.3";
|
|
36
36
|
/** Severity levels — these strings match the backend `ErrorSeverity` enum exactly. */
|
|
37
37
|
type Severity = 'Debug' | 'Info' | 'Warning' | 'Error' | 'Critical';
|
|
38
38
|
/** A trail entry giving context that led up to an error. */
|
package/dist/react/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {Component,useRef,useEffect,useCallback}from'react';import {jsx,Fragment}from'react/jsx-runtime';var h="1.0.
|
|
2
|
+
import {Component,useRef,useEffect,useCallback}from'react';import {jsx,Fragment}from'react/jsx-runtime';var h="1.0.3";function d(){return typeof window<"u"&&typeof document<"u"}function m(){return new Date().toISOString()}function a(r,e){return e<=0?"":r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function C(r,e=24e3){let t=new WeakSet;try{let n=JSON.stringify(r,(o,s)=>{if(s instanceof Error)return {name:s.name,message:s.message,stack:s.stack};if(typeof s=="object"&&s!==null){if(t.has(s))return "[Circular]";t.add(s);}if(typeof s=="bigint")return s.toString();if(typeof s!="function")return s});return n===void 0||n.length>e?void 0:n}catch{return}}function B(r,e){return !r||e.length===0?false:e.some(t=>typeof t=="string"?r.includes(t):t.test(r))}function _(r){let e=r.replace(/\/+$/,"");return `${/\/api\/v\d+$/.test(e)?e:`${e}/api/v1`}/errors/batch`}var g=class{constructor(e){this.max=e;this.items=[];this.teardown=[];}add(e){this.items.push({timestamp:e.timestamp??m(),category:e.category,message:a(e.message,500),level:e.level,data:e.data}),this.items.length>this.max&&this.items.shift();}snapshot(){return this.items.slice()}install(){d()&&(this.installHistory(),this.installClicks(),this.installFetch());}installHistory(){try{let e=window.history,t=o=>{let s=e[o];if(typeof s!="function")return ()=>{};let i=(...l)=>{try{let u=l[2];typeof u=="string"&&this.add({category:"navigation",message:`${o} \u2192 ${u}`});}catch{}return s.apply(window.history,l)};return e[o]=i,()=>{e[o]===i&&(e[o]=s);}};this.teardown.push(t("pushState"),t("replaceState"));let n=()=>this.add({category:"navigation",message:`popstate \u2192 ${location.pathname}`});window.addEventListener("popstate",n),this.teardown.push(()=>window.removeEventListener("popstate",n));}catch{}}installClicks(){try{let e=t=>{let n=t.target;if(!n||typeof n.tagName!="string")return;let o=n.id?`#${n.id}`:"",s=typeof n.className=="string"?n.className:"",i=s?`.${s.split(/\s+/).filter(Boolean).slice(0,2).join(".")}`:"";this.add({category:"click",message:`${n.tagName.toLowerCase()}${o}${i}`});};window.addEventListener("click",e,{capture:!0,passive:!0}),this.teardown.push(()=>window.removeEventListener("click",e,{capture:!0}));}catch{}}installFetch(){try{let e=window.fetch;if(typeof e!="function")return;let t=(...n)=>{let[o,s]=n,i=s?.method??(typeof o=="object"&&o&&"method"in o?o.method:"GET"),l=typeof o=="string"?o:o instanceof URL?o.href:o.url;return e.apply(window,n).then(u=>(this.add({category:"fetch",message:`${i} ${l} \u2192 ${u.status}`,level:u.ok?void 0:"Warning"}),u),u=>{throw this.add({category:"fetch",message:`${i} ${l} \u2192 failed`,level:"Warning"}),u})};window.fetch=t,this.teardown.push(()=>{window.fetch===t&&(window.fetch=e);});}catch{}}close(){for(let e of this.teardown.splice(0))try{e();}catch{}}};var y=class{constructor(e=4e3,t=100){this.windowMs=e;this.max=t;this.seen=new Map;}shouldSend(e){let t=Date.now(),n=this.seen.get(e);if(n!==void 0&&t-n<this.windowMs)return false;if(this.seen.set(e,t),this.seen.size>this.max){let o=this.seen.keys().next().value;o!==void 0&&this.seen.delete(o);}return true}};function D(r,e){let t=(e??"").split(`
|
|
3
3
|
`).slice(0,4).map(n=>n.replace(/:\d+:\d+/g,"").replace(/\?[^\s)]*/g,"").replace(/https?:\/\/[^/]+/g,"").trim()).join("|");return `${r}::${t}`.slice(0,500)}function j(r){if(!d())return ()=>{};let e=r.config,t=[];if(e.captureUnhandledErrors||e.captureResourceErrors){let n=o=>{try{let s=o.target;if(s instanceof HTMLElement){if(!e.captureResourceErrors)return;let l=s,u=l.src||l.href;if(!u)return;r.captureMessage(`Resource failed to load: ${u}`,"Warning",{context:{resource:s.tagName.toLowerCase(),url:u}});return}if(!e.captureUnhandledErrors)return;let i=o;if(!i.error&&(!i.message||i.message==="Script error."))return;r.captureException(i.error??i.message);}catch{}};window.addEventListener("error",n,true),t.push(()=>window.removeEventListener("error",n,true));}if(e.captureUnhandledRejections){let n=o=>{try{r.captureException(o.reason??"Unhandled promise rejection",{context:{unhandledRejection:!0}});}catch{}};window.addEventListener("unhandledrejection",n),t.push(()=>window.removeEventListener("unhandledrejection",n));}if(e.captureConsole){let n=console;for(let o of ["error","warn"]){let s=n[o];if(typeof s!="function")continue;let i=(...l)=>{try{r.addBreadcrumb({category:"console",level:o==="error"?"Error":"Warning",message:l.map(q).join(" ").slice(0,500)});}catch{}return s.apply(console,l)};n[o]=i,t.push(()=>{n[o]===i&&(n[o]=s);});}}return ()=>{for(let n of t.splice(0))try{n();}catch{}}}function q(r){if(typeof r=="string")return r;if(r instanceof Error)return `${r.name}: ${r.message}`;try{return JSON.stringify(r)??String(r)}catch{return String(r)}}var b=2e3,S=8e3,R=4e3;function $(r){if(r instanceof Error)return {message:a(r.message||r.name||"Error",b),exceptionType:r.name||"Error",stackTrace:r.stack?a(r.stack,S):void 0,innerException:P(r.cause)};if(typeof r=="string")return {message:a(r,b),exceptionType:"Error"};if(r&&typeof r=="object"){let e=r,t=typeof e.message=="string"?e.message:O(e)??Object.prototype.toString.call(r),n=typeof e.name=="string"?e.name:"Error",o=typeof e.stack=="string"?e.stack:void 0;return {message:a(t,b),exceptionType:n,stackTrace:o?a(o,S):void 0,innerException:P(e.cause)}}return {message:a(String(r),b),exceptionType:"Error"}}function L(r){if(r.stackTrace)return r;try{let e=new Error(r.message).stack;if(e){let t=e.split(`
|
|
4
4
|
`).slice(2).join(`
|
|
5
5
|
`);return {...r,stackTrace:a(t||e,S)}}}catch{}return r}function P(r){if(r==null)return;if(r instanceof Error){let t=[`${r.name}: ${r.message}`];r.stack&&t.push(r.stack);let n=P(r.cause);return n&&t.push(`Caused by: ${n}`),a(t.join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cherrypeak-org/cherryboard-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Browser & React error tracking client for the CherryBoard dashboard (CherryPeak).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
11
|
"!dist/**/*.map",
|
|
12
|
-
"
|
|
12
|
+
"cli",
|
|
13
13
|
"README.md",
|
|
14
14
|
"CHANGELOG.md"
|
|
15
15
|
],
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
71
|
"bin": {
|
|
72
|
-
"cherryboard-upload-sourcemaps": "./
|
|
72
|
+
"cherryboard-upload-sourcemaps": "./cli/cherryboard-upload-sourcemaps.mjs"
|
|
73
73
|
},
|
|
74
74
|
"repository": {
|
|
75
75
|
"type": "git",
|
|
File without changes
|