File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # <img src =" src/logo.svg " alt =" @knighted/develop logo " width =" 36 " height =" 36 " style =" vertical-align : middle ;" /> <span style =" vertical-align : middle ;" ><code >@knighted/develop </code ></span >
1+ <h1 >
2+ <img src="src/logo.svg" alt="@knighted/develop logo" width="32" height="32" valign="middle" />
3+ <code>@knighted/develop</code>
4+ </h1 >
25
36CDN-first browser IDE for building UI components with [ ` @knighted/jsx ` ] ( https://github.com/knightedcodemonkey/jsx ) and [ ` @knighted/css ` ] ( https://github.com/knightedcodemonkey/css ) .
47
Original file line number Diff line number Diff line change @@ -47,9 +47,8 @@ const normalizeLintDiagnostic = diagnostic => {
4747}
4848
4949const formatLintDiagnosticMessage = diagnostic => {
50- const normalized = normalizeLintDiagnostic ( diagnostic )
51- const ruleSuffix = normalized . ruleId ? ` (${ normalized . ruleId } )` : ''
52- return `${ normalized . message } ${ ruleSuffix } `
50+ const ruleSuffix = diagnostic . ruleId ? ` (${ diagnostic . ruleId } )` : ''
51+ return `${ diagnostic . message } ${ ruleSuffix } `
5352}
5453
5554const buildLintDiagnosticsSummary = ( { diagnostics, okHeadline, errorHeadline } ) => {
Original file line number Diff line number Diff line change @@ -292,10 +292,18 @@ export const createTypeDiagnosticsController = ({
292292 { orderedFallback = false } = { } ,
293293 ) => {
294294 if ( orderedFallback ) {
295- const tryUrlAt = async ( index , firstError = null ) => {
295+ const tryUrlAt = async ( index , failures = [ ] ) => {
296296 if ( index >= urls . length ) {
297+ const reasons = failures
298+ . slice ( 0 , 3 )
299+ . map ( reason => ( reason instanceof Error ? reason . message : String ( reason ) ) )
300+ const reasonSummary = reasons . length ? ` Causes: ${ reasons . join ( ' | ' ) } ` : ''
301+
297302 throw new Error (
298- `${ errorPrefix } : Tried URLs: ${ urls . join ( ', ' ) } .${ firstError ? ` ${ firstError } ` : '' } ` ,
303+ `${ errorPrefix } : Tried URLs: ${ urls . join ( ', ' ) } .${ reasonSummary } ` ,
304+ {
305+ cause : failures . at ( - 1 ) ,
306+ } ,
299307 )
300308 }
301309
@@ -309,8 +317,7 @@ export const createTypeDiagnosticsController = ({
309317
310318 return response . text ( )
311319 } catch ( error ) {
312- const message = error instanceof Error ? error . message : String ( error )
313- return tryUrlAt ( index + 1 , firstError ?? message )
320+ return tryUrlAt ( index + 1 , [ ...failures , error ] )
314321 }
315322 }
316323
You can’t perform that action at this time.
0 commit comments