diff --git a/lighthouse-plugin-ecoindex/audits/bp/print-css.js b/lighthouse-plugin-ecoindex/audits/bp/print-css.js index 4abf8d0f..a3a834c3 100644 --- a/lighthouse-plugin-ecoindex/audits/bp/print-css.js +++ b/lighthouse-plugin-ecoindex/audits/bp/print-css.js @@ -5,50 +5,21 @@ */ import { Audit } from 'lighthouse' -import refCnumr from './ref-cnumr.js' +import refsURLS from './refs-urls.js' class BPPrintCSS extends Audit { static get meta() { return { id: 'bp-print-css', - title: 'Print CSS', - failureTitle: 'No print css implemented.', - description: `A print css must be implemented to hide useless elements when printing. [See CNUMR BP_027](${refCnumr.bp_027.en})`, + title: '#RWEB_027 - Print CSS', + failureTitle: '#RWEB_027 - No print css implemented.', + description: `A print css must be implemented to hide useless elements when printing. [See #RWEB_027](${refsURLS.rweb.bp_027.en})`, // The name of the custom gatherer class that provides input to this audit. requiredArtifacts: ['LinkElements', 'DOMStats', 'devtoolsLogs'], } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'print-css-audit', - // title: 'print-css-audit', - // description: 'print-css-audit.', - // scoreDisplayMode: 'numeric', - // }, - // ] - // } - static audit(artifacts) { const stylesheets = artifacts.LinkElements.filter( link => diff --git a/lighthouse-plugin-ecoindex/audits/bp/ref-cnumr.js b/lighthouse-plugin-ecoindex/audits/bp/ref-cnumr.js deleted file mode 100644 index 3349fd21..00000000 --- a/lighthouse-plugin-ecoindex/audits/bp/ref-cnumr.js +++ /dev/null @@ -1,30 +0,0 @@ -export default { - greenwebfoundation: { - fr: 'https://www.thegreenwebfoundation.org/', - en: 'https://www.thegreenwebfoundation.org/', - }, - greenwebfoundation_API: { - fr: 'https://developers.thegreenwebfoundation.org/api/greencheck/v3/check-single-domain/', - en: 'https://developers.thegreenwebfoundation.org/api/greencheck/v3/check-single-domain/', - }, - ecoindex_method: { - fr: 'https://www.ecoindex.fr/comment-ca-marche/#m%C3%A9thodologie-danalyse', - en: 'https://www.ecoindex.fr/comment-ca-marche/#m%C3%A9thodologie-danalyse', - }, - ecoindex_grade: { - fr: 'https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-la-note', - en: 'https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-la-note', - }, - ecoindex_score: { - fr: 'https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-lecoindex', - en: 'https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-lecoindex', - }, - ecoindex_footprint: { - fr: 'https://www.ecoindex.fr/comment-ca-marche/#lempreinte-environnementale', - en: 'https://www.ecoindex.fr/comment-ca-marche/#lempreinte-environnementale', - }, - bp_027: { - fr: 'https://github.com/cnumr/best-practices/blob/main/chapters/BP_027_fr.md', - en: 'https://github.com/cnumr/best-practices/blob/main/chapters/BP_027_en.md', - }, -} diff --git a/lighthouse-plugin-ecoindex/audits/bp/refs-urls.js b/lighthouse-plugin-ecoindex/audits/bp/refs-urls.js new file mode 100644 index 00000000..9a6ce1ce --- /dev/null +++ b/lighthouse-plugin-ecoindex/audits/bp/refs-urls.js @@ -0,0 +1,36 @@ +export default { + greenwebfoundation: { + home: { + fr: 'https://www.thegreenwebfoundation.org/', + en: 'https://www.thegreenwebfoundation.org/', + }, + api_doc: { + fr: 'https://developers.thegreenwebfoundation.org/api/greencheck/v3/check-single-domain/', + en: 'https://developers.thegreenwebfoundation.org/api/greencheck/v3/check-single-domain/', + }, + }, + ecoindex: { + method: { + fr: 'https://www.ecoindex.fr/comment-ca-marche/#m%C3%A9thodologie-danalyse', + en: 'https://www.ecoindex.fr/comment-ca-marche/#m%C3%A9thodologie-danalyse', + }, + grade: { + fr: 'https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-la-note', + en: 'https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-la-note', + }, + score: { + fr: 'https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-lecoindex', + en: 'https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-lecoindex', + }, + footprint: { + fr: 'https://www.ecoindex.fr/comment-ca-marche/#lempreinte-environnementale', + en: 'https://www.ecoindex.fr/comment-ca-marche/#lempreinte-environnementale', + }, + }, + rweb: { + bp_027: { + fr: 'https://github.com/cnumr/best-practices/blob/main/chapters/BP_027_fr.md', + en: 'https://github.com/cnumr/best-practices/blob/main/chapters/BP_027_en.md', + }, + }, +} diff --git a/lighthouse-plugin-ecoindex/audits/bp/thegreenwebfoundation.js b/lighthouse-plugin-ecoindex/audits/bp/thegreenwebfoundation.js index 3b746ad9..f0d5abf6 100644 --- a/lighthouse-plugin-ecoindex/audits/bp/thegreenwebfoundation.js +++ b/lighthouse-plugin-ecoindex/audits/bp/thegreenwebfoundation.js @@ -1,6 +1,6 @@ import { Audit } from 'lighthouse' import { createErrorResult } from '../../utils/index.js' -import refCnumr from './ref-cnumr.js' +import refsURLS from './refs-urls.js' function makeTableDetails(domain, jsonResponse) { const { hosted_by, hosted_by_website, modified, supporting_documents } = @@ -26,7 +26,7 @@ function makeTableDetails(domain, jsonResponse) { ] const moreInfo = { label: `more info on The Green Web Foundation API v3`, - data: `see ${refCnumr.greenwebfoundation_API.en}`, + data: `see ${refsURLS.greenwebfoundation.api_doc.en}`, } switch (jsonResponse['data']) { case false: @@ -96,7 +96,7 @@ class TheGreenWebFoundation extends Audit { id: 'bp-thegreenwebfoundation', title: 'The Green Web Foundation', failureTitle: 'Your website is not hosted on a green web host.', - description: `The Green Web Foundation is a non-profit organisation on a mission to make the web green by creating tools for a sustainable web. [See The Green Web Foundation](${refCnumr.greenwebfoundation.en})`, + description: `The Green Web Foundation is a non-profit organisation on a mission to make the web green by creating tools for a sustainable web. [See The Green Web Foundation](${refsURLS.greenwebfoundation.home.en})`, // The name of the custom gatherer class that provides input to this audit. requiredArtifacts: ['URL', 'devtoolsLogs'], @@ -109,7 +109,7 @@ class TheGreenWebFoundation extends Audit { id: 'bp-thegreenwebfoundation', title: 'The Green Web Foundation', description: - 'The Green Web Foundation is a non-profit organisation on a mission to make the web green by creating tools for a sustainable web. [See The Green Web Foundation](${refCnumr.greenwebfoundation.en})', + 'The Green Web Foundation is a non-profit organisation on a mission to make the web green by creating tools for a sustainable web. [See The Green Web Foundation](${refsURLS.greenwebfoundation.home.en})', scoreDisplayMode: 'manual', }, ] diff --git a/lighthouse-plugin-ecoindex/audits/ecoindex-ghg.js b/lighthouse-plugin-ecoindex/audits/ecoindex-ghg.js index 18eaaf1c..015e9344 100644 --- a/lighthouse-plugin-ecoindex/audits/ecoindex-ghg.js +++ b/lighthouse-plugin-ecoindex/audits/ecoindex-ghg.js @@ -5,7 +5,7 @@ import { } from '../utils/index.js' import { Audit } from 'lighthouse' -import refCnumr from './bp/ref-cnumr.js' +import refsURLS from './bp/refs-urls.js' class EcoindexGreenhouseGasEmissionAudit extends Audit { static get meta() { @@ -14,42 +14,13 @@ class EcoindexGreenhouseGasEmissionAudit extends Audit { title: 'Greenhouse Gas Emission (eqCO2)', failureTitle: 'Greenhouse Gas Emission (eqCO2), your page generates a lot of greenhouse gas', - description: `Greenhouse Gas Emission (eqCO2) of your page. [See Ecoindex, Environmental footprint](${refCnumr.ecoindex_footprint.en})`, + description: `Greenhouse Gas Emission (eqCO2) of your page. [See Ecoindex, Environmental footprint](${refsURLS.ecoindex.footprint.en})`, requiredArtifacts: ['MainDocumentContent', 'DOMStats', 'devtoolsLogs'], supportedModes: ['navigation', 'timespan', 'snapshot'], scoreDisplayMode: 'numeric', } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'eco-index-ghg', - // title: 'Greenhouse Gas Emission', - // description: 'Greenhouse Gas Emission (eqCO2) of your page.', - // scoreDisplayMode: 'numeric', - // }, - // ] - // } - static async audit(artifacts, context) { try { const ecoIndexScore = await getLoadingExperience(artifacts, context) diff --git a/lighthouse-plugin-ecoindex/audits/ecoindex-grade.js b/lighthouse-plugin-ecoindex/audits/ecoindex-grade.js index 7a596042..5379610c 100644 --- a/lighthouse-plugin-ecoindex/audits/ecoindex-grade.js +++ b/lighthouse-plugin-ecoindex/audits/ecoindex-grade.js @@ -5,7 +5,7 @@ import { } from '../utils/index.js' import { Audit } from 'lighthouse' -import refCnumr from './bp/ref-cnumr.js' +import refsURLS from './bp/refs-urls.js' class EcoindexGradeAudit extends Audit { static get meta() { @@ -13,43 +13,13 @@ class EcoindexGradeAudit extends Audit { id: 'eco-index-grade', title: 'Grade', failureTitle: 'Grade, your page has a big impact', - description: `The EcoIndex score evaluating the environmental impact of the page. [See Ecoindex, Calculating the score](${refCnumr.ecoindex_grade.en})`, + description: `The EcoIndex score evaluating the environmental impact of the page. [See Ecoindex, Calculating the score](${refsURLS.ecoindex.grade.en})`, requiredArtifacts: ['MainDocumentContent', 'DOMStats', 'devtoolsLogs'], supportedModes: ['navigation', 'timespan', 'snapshot'], scoreDisplayMode: 'numeric', } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'eco-index-grade', - // title: 'Ecoindex Grade', - // description: - // 'The EcoIndex score evaluating the environmental impact of the page.', - // scoreDisplayMode: 'manual', - // }, - // ] - // } - static async audit(artifacts, context) { try { const ecoIndexScore = await getLoadingExperience(artifacts, context) diff --git a/lighthouse-plugin-ecoindex/audits/ecoindex-nodes.js b/lighthouse-plugin-ecoindex/audits/ecoindex-nodes.js index 52756260..d29e97d3 100644 --- a/lighthouse-plugin-ecoindex/audits/ecoindex-nodes.js +++ b/lighthouse-plugin-ecoindex/audits/ecoindex-nodes.js @@ -5,7 +5,7 @@ import { } from '../utils/index.js' import { Audit } from 'lighthouse' -import refCnumr from './bp/ref-cnumr.js' +import refsURLS from './bp/refs-urls.js' class EcoindexNodesAudit extends Audit { static get meta() { @@ -13,42 +13,13 @@ class EcoindexNodesAudit extends Audit { id: 'eco-index-nodes', title: 'Ecoindex DOM elements (nodes)', failureTitle: 'Ecoindex DOM elements (nodes), your page is too complex', - description: `Explication: Counting all the DOM nodes on the page, excluding the child nodes of \`svg\` elements, gives us the number of DOM elements on the page. This method encourages you not to replace a complex svg with an image, simply to obtain a better score. [See Ecoindex, Analysis methodology](${refCnumr.ecoindex_method.en})`, + description: `Explication: Counting all the DOM nodes on the page, excluding the child nodes of \`svg\` elements, gives us the number of DOM elements on the page. This method encourages you not to replace a complex svg with an image, simply to obtain a better score. [See Ecoindex, Analysis methodology](${refsURLS.ecoindex.method.en})`, requiredArtifacts: ['MainDocumentContent', 'DOMStats', 'devtoolsLogs'], supportedModes: ['navigation', 'timespan', 'snapshot'], scoreDisplayMode: 'numeric', } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'eco-index-nodes', - // title: 'DOM elements', - // description: `Explication: Counting all the DOM nodes on the page, excluding the child nodes of \`svg\` elements, gives us the number of DOM elements on the page. This method encourages you not to replace a complex svg with an image, simply to obtain a better score. [See Ecoindex, Analysis methodology](${refCnumr.ecoindex_method.en})`, - // scoreDisplayMode: 'numeric', - // }, - // ] - // } - static async audit(artifacts, context) { try { const ecoIndexScore = await getLoadingExperience(artifacts, context, true) diff --git a/lighthouse-plugin-ecoindex/audits/ecoindex-requests.js b/lighthouse-plugin-ecoindex/audits/ecoindex-requests.js index 2f5a29b2..e221e63a 100644 --- a/lighthouse-plugin-ecoindex/audits/ecoindex-requests.js +++ b/lighthouse-plugin-ecoindex/audits/ecoindex-requests.js @@ -5,7 +5,7 @@ import { } from '../utils/index.js' import { Audit } from 'lighthouse' -import refCnumr from './bp/ref-cnumr.js' +import refsURLS from './bp/refs-urls.js' class EcoindexRequestsAudit extends Audit { static get meta() { @@ -14,43 +14,13 @@ class EcoindexRequestsAudit extends Audit { title: 'Number of requests', failureTitle: 'Number of requests, your page calls too many external resources', - description: `The number of \`Network.loadingFinished\` logs indicates the number of requests made to external resources. [See Ecoindex, Analysis methodology](${refCnumr.ecoindex_method.en})`, + description: `The number of \`Network.loadingFinished\` logs indicates the number of requests made to external resources. [See Ecoindex, Analysis methodology](${refsURLS.ecoindex.method.en})`, requiredArtifacts: ['MainDocumentContent', 'DOMStats', 'devtoolsLogs'], supportedModes: ['navigation', 'timespan', 'snapshot'], scoreDisplayMode: 'numeric', } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'eco-index-requests', - // title: 'Number of requests', - // description: - // 'The EcoIndex score evaluating the environmental impact of the page.', - // scoreDisplayMode: 'numeric', - // }, - // ] - // } - static async audit(artifacts, context) { try { const ecoIndexScore = await getLoadingExperience(artifacts, context, true) diff --git a/lighthouse-plugin-ecoindex/audits/ecoindex-score.js b/lighthouse-plugin-ecoindex/audits/ecoindex-score.js index 771f2fad..28d7ac37 100644 --- a/lighthouse-plugin-ecoindex/audits/ecoindex-score.js +++ b/lighthouse-plugin-ecoindex/audits/ecoindex-score.js @@ -5,7 +5,7 @@ import { } from '../utils/index.js' import { Audit } from 'lighthouse' -import refCnumr from './bp/ref-cnumr.js' +import refsURLS from './bp/refs-urls.js' class EcoindexScoreAudit extends Audit { static get meta() { @@ -13,43 +13,13 @@ class EcoindexScoreAudit extends Audit { id: 'eco-index-score', title: 'Ecoindex revealant metrics', failureTitle: 'Ecoindex, your page has an impact', - description: `The EcoIndex score evaluating the environmental impact of the page. [See Ecoindex, Calculating the EcoIndex](${refCnumr.ecoindex_score.en})`, + description: `The EcoIndex score evaluating the environmental impact of the page. [See Ecoindex, Calculating the EcoIndex](${refsURLS.ecoindex.score.en})`, requiredArtifacts: ['MainDocumentContent', 'DOMStats', 'devtoolsLogs'], supportedModes: ['navigation', 'timespan', 'snapshot'], scoreDisplayMode: 'numeric', } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'eco-index-score', - // title: 'EcoIndex Score', - // description: - // 'The EcoIndex score evaluating the environmental impact of the page.', - // scoreDisplayMode: 'numeric', - // }, - // ] - // } - static async audit(artifacts, context) { try { const ecoIndexScore = await getLoadingExperience(artifacts, context) diff --git a/lighthouse-plugin-ecoindex/audits/ecoindex-size.js b/lighthouse-plugin-ecoindex/audits/ecoindex-size.js index 73aa4ea1..badea461 100644 --- a/lighthouse-plugin-ecoindex/audits/ecoindex-size.js +++ b/lighthouse-plugin-ecoindex/audits/ecoindex-size.js @@ -5,7 +5,7 @@ import { } from '../utils/index.js' import { Audit } from 'lighthouse' -import refCnumr from './bp/ref-cnumr.js' +import refsURLS from './bp/refs-urls.js' class EcoindexSizeAudit extends Audit { static get meta() { @@ -13,42 +13,13 @@ class EcoindexSizeAudit extends Audit { id: 'eco-index-size', title: 'Page size in Megaoctets', failureTitle: 'Page size in Megaoctets, your page is too heavy', - description: `The sum of all the \`encodedDataLengths\` of these same requests + the html size of the page itself calculates the page weight. [See Ecoindex, Analysis methodology](${refCnumr.ecoindex_method.en})`, + description: `The sum of all the \`encodedDataLengths\` of these same requests + the html size of the page itself calculates the page weight. [See Ecoindex, Analysis methodology](${refsURLS.ecoindex.method.en})`, requiredArtifacts: ['MainDocumentContent', 'DOMStats', 'devtoolsLogs'], supportedModes: ['navigation', 'timespan', 'snapshot'], scoreDisplayMode: 'numeric', } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'eco-index-size', - // title: 'Page size in Megaoctets', - // description: 'The total size of all assets and page, in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // ] - // } - static async audit(artifacts, context) { try { const ecoIndexScore = await getLoadingExperience(artifacts, context, true) diff --git a/lighthouse-plugin-ecoindex/audits/ecoindex-water.js b/lighthouse-plugin-ecoindex/audits/ecoindex-water.js index 6fb9cea0..c5ca24c6 100644 --- a/lighthouse-plugin-ecoindex/audits/ecoindex-water.js +++ b/lighthouse-plugin-ecoindex/audits/ecoindex-water.js @@ -5,7 +5,7 @@ import { } from '../utils/index.js' import { Audit } from 'lighthouse' -import refCnumr from './bp/ref-cnumr.js' +import refsURLS from './bp/refs-urls.js' class EcoindexWaterConsumptionAudit extends Audit { static get meta() { @@ -13,42 +13,13 @@ class EcoindexWaterConsumptionAudit extends Audit { id: 'eco-index-water', title: 'Water Consumption (cl)', failureTitle: 'Water Consumption (cl), your page consumes a lot of water', - description: `The quantity of water consumed by the page. [See Ecoindex, Environmental footprint](${refCnumr.ecoindex_footprint.en})`, + description: `The quantity of water consumed by the page. [See Ecoindex, Environmental footprint](${refsURLS.ecoindex.footprint.en})`, requiredArtifacts: ['MainDocumentContent', 'DOMStats', 'devtoolsLogs'], supportedModes: ['navigation', 'timespan', 'snapshot'], scoreDisplayMode: 'numeric', } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'eco-index-water', - // title: 'Water Consumption', - // description: 'The quantity of water consumed by the page.', - // scoreDisplayMode: 'numeric', - // }, - // ] - // } - static async audit(artifacts, context) { try { const ecoIndexScore = await getLoadingExperience(artifacts, context) diff --git a/lighthouse-plugin-ecoindex/audits/warn-nodes-count.js b/lighthouse-plugin-ecoindex/audits/warn-nodes-count.js index 9dba2caf..8dca907d 100644 --- a/lighthouse-plugin-ecoindex/audits/warn-nodes-count.js +++ b/lighthouse-plugin-ecoindex/audits/warn-nodes-count.js @@ -6,7 +6,7 @@ import { Audit } from 'lighthouse' import { getEcoindexNodes } from '../utils/index.js' -import refCnumr from './bp/ref-cnumr.js' +import refsURLS from './bp/refs-urls.js' class WarnNodesCount extends Audit { static get meta() { @@ -15,42 +15,13 @@ class WarnNodesCount extends Audit { title: '⚠️ Ecoindex nodes number might be ≠ Lighthouse nodes number.', failureTitle: '⚠️ Ecoindex nodes number might be ≠ Lighthouse nodes number.', - description: `Explication: Counting all the DOM nodes on the page, excluding the child nodes of \`svg\` elements, gives us the number of DOM elements on the page. This method encourages you not to replace a complex svg with an image, simply to obtain a better score. [See Ecoindex, Analysis methodology](${refCnumr.ecoindex_method.en})`, + description: `Explication: Counting all the DOM nodes on the page, excluding the child nodes of \`svg\` elements, gives us the number of DOM elements on the page. This method encourages you not to replace a complex svg with an image, simply to obtain a better score. [See Ecoindex, Analysis methodology](${refsURLS.ecoindex.method.en})`, // The name of the custom gatherer class that provides input to this audit. requiredArtifacts: ['MainDocumentContent', 'DOMStats', 'devtoolsLogs'], } } - // static get metrics() { - // return [ - // { - // id: 'dom-size', - // title: 'DOM Size', - // description: 'The size of the DOM in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'request-count', - // title: 'Request Count', - // description: 'The number of network requests made by the page.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'total-compressed-size', - // title: 'Total Compressed Size', - // description: 'The total size of all compressed responses in bytes.', - // scoreDisplayMode: 'numeric', - // }, - // { - // id: 'custom-audit', - // title: 'custom-audit', - // description: 'custom-audit.', - // scoreDisplayMode: 'numeric', - // }, - // ] - // } - static async audit(artifacts) { // const MainDocumentContent = artifacts.MainDocumentContent // const dom = new JSDOM(MainDocumentContent) diff --git a/lighthouse-plugin-ecoindex/plugin.js b/lighthouse-plugin-ecoindex/plugin.js index 9875c773..1ded59e9 100644 --- a/lighthouse-plugin-ecoindex/plugin.js +++ b/lighthouse-plugin-ecoindex/plugin.js @@ -30,17 +30,26 @@ export default { groups: { ecologic: { title: 'Ecoindex results', - description: 'Ecoindex revealant metrics', + description: 'Ecoindex revealant metrics.', }, technic: { title: 'Technical results', - description: 'Technical metrics', + description: 'Technical metrics.', }, 'best-practices': { - title: 'Best practices', + title: '#RWEB web eco-design: 115 best practices', description: 'CNUMR (Collectif Conception Numérique Responsable) "115 best practices" reference framework.', }, + 'rgesn-practices': { + title: + '#RGESN General eco-design guidelines for digital servicesBest practices', + description: 'General eco-design guidelines for digital services.', + }, + 'other-practices': { + title: 'Other ecodesign best practices', + description: 'Various best practices in eco-design.', + }, }, // A new category in the report for the plugin output. category: { @@ -64,7 +73,7 @@ export default { { id: 'eco-index-requests', weight: 0, group: 'technic' }, // best-practices { id: 'bp-print-css', weight: 0, group: 'best-practices' }, - { id: 'bp-thegreenwebfoundation', weight: 0, group: 'best-practices' }, + { id: 'bp-thegreenwebfoundation', weight: 0, group: 'other-practices' }, ], }, }