@lhci/server
Advanced tools
Comparing version 0.1.1-alpha.9 to 0.1.1-alpha.10
@@ -55,3 +55,3 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"PBm5":[function(require,module,exports) { | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.App=void 0;var e=require("preact"),r=u(require("preact-router")),t=u(require("preact-async-route")),o=require("./components/redirect.jsx");require("./app.css");var l=require("./layout/page.jsx");function u(e){return e&&e.__esModule?e:{default:e}}const a=()=>(0,e.h)("h1",null,"Loading route..."),p=()=>(0,e.h)("div",{className:"lhci"},(0,e.h)(r.default,null,(0,e.h)(t.default,{path:"/app/projects",loading:()=>(0,e.h)(l.Page,null,(0,e.h)(a,null)),getComponent:()=>require("_bundle_loader")(require.resolve("./routes/project-list/project-list.jsx")).then(e=>e.ProjectList)}),(0,e.h)(t.default,{path:"/app/projects/:projectId",loading:()=>(0,e.h)(l.Page,null,(0,e.h)(a,null)),getComponent:()=>require("_bundle_loader")(require.resolve("./routes/project-dashboard/project-dashboard.jsx")).then(e=>e.ProjectDashboard)}),(0,e.h)(t.default,{path:"/app/projects/:projectId/builds/:buildId",loading:()=>(0,e.h)(l.Page,null,(0,e.h)(a,null)),getComponent:()=>require("_bundle_loader")(require.resolve("./routes/build-view/build-view.jsx")).then(e=>e.BuildView)}),(0,e.h)(o.Redirect,{default:!0,to:"/app/projects"})));exports.App=p; | ||
},{"preact":"PBm5","preact-router":"K0uB","preact-async-route":"Mzbx","./components/redirect.jsx":"ds4X","./app.css":"pKEH","./layout/page.jsx":"yJiI","_bundle_loader":"4iMR","./routes/project-list/project-list.jsx":[["project-list.859d95c4.js","GGjE"],"project-list.859d95c4.js.map","GGjE"],"./routes/project-dashboard/project-dashboard.jsx":[["project-dashboard.a59472f5.js","dgTn"],"project-dashboard.a59472f5.js.map","project-dashboard.e90b4c78.css","dgTn"],"./routes/build-view/build-view.jsx":[["build-view.55c194af.js","8mpF"],"build-view.55c194af.js.map","build-view.ca61a439.css","8mpF"]}],"OHmn":[function(require,module,exports) { | ||
},{"preact":"PBm5","preact-router":"K0uB","preact-async-route":"Mzbx","./components/redirect.jsx":"ds4X","./app.css":"pKEH","./layout/page.jsx":"yJiI","_bundle_loader":"4iMR","./routes/project-list/project-list.jsx":[["project-list.859d95c4.js","GGjE"],"project-list.859d95c4.js.map","GGjE"],"./routes/project-dashboard/project-dashboard.jsx":[["project-dashboard.a59472f5.js","dgTn"],"project-dashboard.a59472f5.js.map","project-dashboard.e90b4c78.css","dgTn"],"./routes/build-view/build-view.jsx":[["build-view.f3a07f18.js","8mpF"],"build-view.f3a07f18.js.map","build-view.9a6a7ac8.css","8mpF"]}],"OHmn":[function(require,module,exports) { | ||
"use strict";var e=require("preact"),r=require("./app.jsx");(0,e.render)((0,e.h)(r.App,null),document.body); | ||
@@ -58,0 +58,0 @@ },{"preact":"PBm5","./app.jsx":"pRI3"}],"OuB2":[function(require,module,exports) { |
{ | ||
"name": "@lhci/server", | ||
"main": "./src/server.js", | ||
"version": "0.1.1-alpha.9", | ||
"version": "0.1.1-alpha.10", | ||
"license": "Apache-2.0", | ||
@@ -20,4 +20,5 @@ "repository": { | ||
"dependencies": { | ||
"@lhci/utils": "0.1.1-alpha.9", | ||
"@lhci/utils": "0.1.1-alpha.10", | ||
"body-parser": "^1.18.3", | ||
"compression": "^1.7.4", | ||
"express": "^4.16.4", | ||
@@ -40,3 +41,3 @@ "morgan": "^1.9.1", | ||
}, | ||
"gitHead": "17acca7d9803c9c36d60b55da6653ca4186a144a" | ||
"gitHead": "f228afebd13f04e8cdc1381e23f589dfc47580e7" | ||
} |
@@ -12,2 +12,3 @@ /** | ||
const morgan = require('morgan'); | ||
const compression = require('compression'); | ||
const bodyParser = require('body-parser'); | ||
@@ -34,2 +35,5 @@ const ApiClient = require('@lhci/utils/src/api-client.js'); | ||
// While LHCI should be served behind nginx/apache that handles compression, it won't always be. | ||
app.use(compression()); | ||
// 1. Support large payloads because LHRs are big. | ||
@@ -36,0 +40,0 @@ // 2. Support JSON primitives because `PUT /builds/<id>/lifecycle "sealed"` |
@@ -8,41 +8,4 @@ /** | ||
import {h, Fragment} from 'preact'; | ||
import {splitMarkdownLink} from '@lhci/utils/src/markdown.js'; | ||
/** | ||
* Split a string on markdown links (e.g. [some link](https://...)) into | ||
* segments of plain text that weren't part of a link (marked as | ||
* `isLink === false`), and segments with text content and a URL that did make | ||
* up a link (marked as `isLink === true`). | ||
* @param {string} text | ||
* @return {Array<{isLink: true, text: string, linkHref: string}|{isLink: false, text: string}>} | ||
*/ | ||
function splitMarkdownLink(text) { | ||
/** @type {Array<{isLink: true, text: string, linkHref: string}|{isLink: false, text: string}>} */ | ||
const segments = []; | ||
const parts = text.split(/\[([^\]]+?)\]\((https?:\/\/.*?)\)/g); | ||
while (parts.length) { | ||
// Shift off the same number of elements as the pre-split and capture groups. | ||
const [preambleText, linkText, linkHref] = parts.splice(0, 3); | ||
if (preambleText) { | ||
// Skip empty text as it's an artifact of splitting, not meaningful. | ||
segments.push({ | ||
isLink: false, | ||
text: preambleText, | ||
}); | ||
} | ||
// Append link if there are any. | ||
if (linkText && linkHref) { | ||
segments.push({ | ||
isLink: true, | ||
text: linkText, | ||
linkHref, | ||
}); | ||
} | ||
} | ||
return segments; | ||
} | ||
/** @param {{text: string}} props */ | ||
@@ -49,0 +12,0 @@ export const Markdown = props => { |
@@ -55,8 +55,15 @@ /** | ||
let display = value; | ||
let hostname = ''; | ||
try { | ||
const url = new URL(value); | ||
display = url.pathname; | ||
hostname = url.hostname; | ||
} catch (_) {} | ||
return <span title={value}>{display}</span>; | ||
return ( | ||
<span title={value}> | ||
{display} | ||
{hostname ? <span className="simple-details__url-hostname">({hostname})</span> : ''} | ||
</span> | ||
); | ||
} | ||
@@ -63,0 +70,0 @@ case 'link': { |
@@ -131,13 +131,21 @@ /** | ||
const categoryIds = Object.keys(lhr.categories); | ||
return ( | ||
<div className="build-score-comparison"> | ||
{Object.keys(lhr.categories).map(id => { | ||
return id === 'pwa' ? ( | ||
<PwaScoreItem lhr={lhr} baseLhr={baseLhr} categoryId={id} /> | ||
) : ( | ||
<StandardScoreItem lhr={lhr} baseLhr={baseLhr} categoryId={id} /> | ||
); | ||
})} | ||
{categoryIds | ||
.sort((idA, idB) => { | ||
const sortKeyA = idA === 'pwa' ? Infinity : categoryIds.indexOf(idA); | ||
const sortKeyB = idB === 'pwa' ? Infinity : categoryIds.indexOf(idB); | ||
return sortKeyA - sortKeyB; | ||
}) | ||
.map(id => { | ||
return id === 'pwa' ? ( | ||
<PwaScoreItem lhr={lhr} baseLhr={baseLhr} categoryId={id} /> | ||
) : ( | ||
<StandardScoreItem lhr={lhr} baseLhr={baseLhr} categoryId={id} /> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; |
@@ -77,3 +77,3 @@ /** | ||
group: intermediateGroup.group, | ||
pairs: auditPairs.sort((a, b) => b.maxSeverity - a.maxSeverity), | ||
pairs: auditPairs.sort((a, b) => (a.audit.score || 0) - (b.audit.score || 0)), | ||
}; | ||
@@ -80,0 +80,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
5423126
8
9882
+ Addedcompression@^1.7.4
+ Added@lhci/utils@0.1.1-alpha.10(transitive)
+ Addedcompressible@2.0.18(transitive)
+ Addedcompression@1.7.5(transitive)
+ Addedmime-db@1.53.0(transitive)
+ Addednegotiator@0.6.4(transitive)
- Removed@lhci/utils@0.1.1-alpha.9(transitive)
Updated@lhci/utils@0.1.1-alpha.10