![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@cnumr/lighthouse-eco-index-aggregator
Advanced tools
Tool for aggregating lighthouse and eco-index results
This generator tool can be used if you need to generate a global reports for all pages audited by lighthouse and ecoindex tools. After the generation, we will have access to a global HTML report. As an example, you can use this tool at the end of a Cypress test suite in order to generate the final report of your tests.
At the end of the readme, we will explain how to generate lighthouse and ecoindex reports, used by this aggregator.
npm install -D @cnumr/lighthouse-eco-index-aggregator
Nom | Type | Description |
---|---|---|
config | string | Option is used for define configuration file (JSON or JavaScript) |
fail | number | Option is used for define limit fail |
h | boolean | Option is used for see informations cli |
lang | string | Option is used for translated report values possible used is "fr-FR" or "en-GB" default is "en-GB" |
m | boolean | Option is used for minify file output it's true by default |
outputPath | string | Option is used in order to define the target folder when the report will be generated |
pass | number | Option is used for define limit pass |
reports | string[] | Option is used for defined the format of the generated report. Possible values "html", "sonar" or a funciton |
sonarFilePath | string | Option is used when generating the sonar report, in order to make the issue visible on SonarCloud |
srcEcoIndex | string | Option is used for defined ecoIndex reports path |
srcLighthouse | string | Option is used for defined lighthouse reports path |
v | boolean | Option is used for verbose task |
npx @cnumr/lighthouse-eco-index-aggregator --srcLighthouse="./reports/lighthouse" --srcEcoIndex="./reports/ecoindex" --reports="html" --outputPath="report_final"
You can also used this module programmatically
const aggregate = require("@cnumr/lighthouse-eco-index-aggregator/src/main");
console.log(
aggregate({
srcLighthouse: "./reports/lighthouse",
srcEcoIndex: "./reports/ecoindex",
outputPath: "report_final",
})
);
This aggregator tool can also be used directly inside a cypress test. For example, we can generate the global report once the Cypress tests suite has finished.
// cypress.config.js
const aggregate = require("@cnumr/lighthouse-eco-index-aggregator/src/main");
const path = require("path");
const lighthouseOutputPathDir = path.join(__dirname, "reports/lighthouse");
const ecoIndexOutputPathDir = path.join(__dirname, "reports/ecoindex");
const globalOutputPathDir = path.join(__dirname, "report_final");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
on("after:run", async () => {
await aggregate({
reports: ["html"],
verbose: true,
srcLighthouse: lighthouseOutputPathDir,
srcEcoIndex: ecoIndexOutputPathDir,
outputPath: globalOutputPathDir,
});
});
},
},
});
But in order to generate this global report, we need the lighthouse and ecoindex reports available in the lighthouse
and ecoindex
subfolders. In order to do so, we will use two extra NPM packages :
You will find a sample Cypress tests suite in the cypress-demo
folder. Please have a look to the demo.cy.js
and cypress.config.js
.
In order to run the Cypress tests suite, you have to execute the following commands :
cd cypress-demo
npm i
npx cypress run -b chrome
This tool can also generate a external sonar report you can add to the Sonar configuration (via the sonar.externalIssuesReportPaths
option).
You need to define the path to one of your file managed by Sonar, in order to make the rule visible in Sonar Cloud and use the sonar
reporter.
node ./src/cli.js --srcLighthouse="./reports/lighthouse" --srcEcoIndex="./reports/ecoindex" --reports="sonar" --sonarFilePath="./package.json"
In fact, the output
option can receive a javaScript function. Thanks to this possibility, you can send the result anywhere (Elastic, DataDog, ...)
// cypress.config.js
const aggregate = require("@cnumr/lighthouse-eco-index-aggregator/src/main");
const path = require("path");
const lighthouseOutputPathDir = path.join(__dirname, "reports/lighthouse");
const ecoIndexOutputPathDir = path.join(__dirname, "reports/ecoindex");
const globalOutputPathDir = path.join(__dirname, "report_final");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
on("after:run", async () => {
await aggregate({
reports: [
"html",
(options, results) => {
const { Client } = require("@elastic/elasticsearch");
const client = new Client();
return client.index({
index: "lighthouse-ecoindex",
document: {
...results,
"@timestamp": new Date(),
},
});
},
],
verbose: true,
srcLighthouse: lighthouseOutputPathDir,
srcEcoIndex: ecoIndexOutputPathDir,
outputPath: globalOutputPathDir,
});
});
},
},
});
FAQs
Tool for aggregating lighthouse and eco-index results
The npm package @cnumr/lighthouse-eco-index-aggregator receives a total of 2 weekly downloads. As such, @cnumr/lighthouse-eco-index-aggregator popularity was classified as not popular.
We found that @cnumr/lighthouse-eco-index-aggregator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.