From 3874f3b8c1ad65fa1cd1fe44526d1887145c4eed Mon Sep 17 00:00:00 2001 From: Dave Vandyke Date: Fri, 6 Dec 2024 11:49:30 +0000 Subject: [PATCH] Update privacy-dashboard dependency to 7.4.0 With this dependency update, the "GetToggleReportOptions" privacy-dashboard message now also handles the "locale" param ID, so let's start passing that too. Also, it seems that the auto-generated shared/js/ui/base/locale-resources.js file fails the new Prettier linting checks. This file should probably live in the build/ directory instead of the source tree, but for now let's at least tweak the script that creates it to follow Prettier's rules. --- package-lock.json | 13 ++++++------- package.json | 2 +- scripts/bundleLocales.mjs | 6 +++--- shared/js/background/components/toggle-reports.js | 1 + unit-test/background/toggle-reports.js | 2 ++ 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index f77fbb355..7d66a2d3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#6.34.0", "@duckduckgo/ddg2dnr": "file:packages/ddg2dnr", "@duckduckgo/jsbloom": "^1.0.2", - "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#7.1.1", + "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#7.4.0", "@duckduckgo/privacy-grade": "file:packages/privacy-grade", "@duckduckgo/privacy-reference-tests": "github:duckduckgo/privacy-reference-tests#main", "@duckduckgo/tracker-surrogates": "github:duckduckgo/tracker-surrogates#1.3.2", @@ -217,10 +217,10 @@ "integrity": "sha512-cJvuLGRnREddo20OCk4qiFUVxS1xA6Y5MRpaDFuzdNkdrs1tF5F52EbfBSGFEbP6i+xUcoVYeqQ7DxT1MPa+jA==" }, "node_modules/@duckduckgo/privacy-dashboard": { - "resolved": "git+ssh://git@github.com/duckduckgo/privacy-dashboard.git#53fd1a0f8d91fcf475d9220f810141007300dffd", - "integrity": "sha512-NwyhnuCVS+DDVgsriZ0olLvYjDUrU4Z8jW4bM1MksF9XdufEZm9NKVc4M1FgSYHJWS2bscLyNSYa/6d2EnUq4A==", + "version": "7.3.2", + "resolved": "git+ssh://git@github.com/duckduckgo/privacy-dashboard.git#022c845b06ace6a4aa712a4fa3e79da32193d5c6", "engines": { - "node": ">=18.0.0", + "node": ">=22.0.0", "npm": ">=9.0.0" } }, @@ -11488,9 +11488,8 @@ "integrity": "sha512-cJvuLGRnREddo20OCk4qiFUVxS1xA6Y5MRpaDFuzdNkdrs1tF5F52EbfBSGFEbP6i+xUcoVYeqQ7DxT1MPa+jA==" }, "@duckduckgo/privacy-dashboard": { - "version": "git+ssh://git@github.com/duckduckgo/privacy-dashboard.git#53fd1a0f8d91fcf475d9220f810141007300dffd", - "integrity": "sha512-NwyhnuCVS+DDVgsriZ0olLvYjDUrU4Z8jW4bM1MksF9XdufEZm9NKVc4M1FgSYHJWS2bscLyNSYa/6d2EnUq4A==", - "from": "@duckduckgo/privacy-dashboard@github:duckduckgo/privacy-dashboard#7.1.1" + "version": "git+ssh://git@github.com/duckduckgo/privacy-dashboard.git#022c845b06ace6a4aa712a4fa3e79da32193d5c6", + "from": "@duckduckgo/privacy-dashboard@github:duckduckgo/privacy-dashboard#7.4.0" }, "@duckduckgo/privacy-grade": { "version": "file:packages/privacy-grade", diff --git a/package.json b/package.json index b03dc6705..80f02d565 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#6.34.0", "@duckduckgo/ddg2dnr": "file:packages/ddg2dnr", "@duckduckgo/jsbloom": "^1.0.2", - "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#7.1.1", + "@duckduckgo/privacy-dashboard": "github:duckduckgo/privacy-dashboard#7.4.0", "@duckduckgo/privacy-grade": "file:packages/privacy-grade", "@duckduckgo/privacy-reference-tests": "github:duckduckgo/privacy-reference-tests#main", "@duckduckgo/tracker-surrogates": "github:duckduckgo/tracker-surrogates#1.3.2", diff --git a/scripts/bundleLocales.mjs b/scripts/bundleLocales.mjs index a7635350c..074f9da8f 100644 --- a/scripts/bundleLocales.mjs +++ b/scripts/bundleLocales.mjs @@ -14,7 +14,7 @@ locales.forEach((lang) => { const resources = namespaces .map((ns) => { const importName = `${lang}${ns[0].toUpperCase()}${ns.slice(1)}`; - imports.push(`import ${importName} from '../../../locales/${lang}/${ns}.json'`); + imports.push(`import ${importName} from '../../../locales/${lang}/${ns}.json';`); return `${ns}: ${importName}`; }) .join(', '); @@ -29,5 +29,5 @@ ${imports.join('\n')} export default { ${Object.keys(localeObjects) .map((lang) => `${lang}: ${localeObjects[lang]}`) - .join(',\n ')} -}`); + .join(',\n ')}, +};`); diff --git a/shared/js/background/components/toggle-reports.js b/shared/js/background/components/toggle-reports.js index 6fddf58fd..b6fe7b2fd 100644 --- a/shared/js/background/components/toggle-reports.js +++ b/shared/js/background/components/toggle-reports.js @@ -59,6 +59,7 @@ export default class ToggleReports { 'features', 'httpErrorCodes', 'jsPerformance', + 'locale', 'openerContext', 'requests', 'userRefreshCount', diff --git a/unit-test/background/toggle-reports.js b/unit-test/background/toggle-reports.js index 2cf8742ac..c1cbc44d2 100644 --- a/unit-test/background/toggle-reports.js +++ b/unit-test/background/toggle-reports.js @@ -87,6 +87,7 @@ describe('ToggleReports', () => { { id: 'features' }, { id: 'httpErrorCodes' }, { id: 'jsPerformance' }, + { id: 'locale' }, { id: 'openerContext' }, { id: 'requests' }, { id: 'userRefreshCount' }, @@ -104,6 +105,7 @@ describe('ToggleReports', () => { { id: 'features' }, { id: 'httpErrorCodes' }, { id: 'jsPerformance' }, + { id: 'locale' }, { id: 'openerContext' }, { id: 'requests' }, { id: 'userRefreshCount' },