@duckduckgo/autoconsent 14.95.0 → 14.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# v14.95.1 (Wed Jun 17 2026)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Preserve JSONC comments when bundling autoconsent config rules [#1395](https://github.com/duckduckgo/autoconsent/pull/1395) ([@cursoragent](https://github.com/cursoragent) [@jonathanKingston](https://github.com/jonathanKingston))
|
|
6
|
+
|
|
7
|
+
#### Authors: 2
|
|
8
|
+
|
|
9
|
+
- Cursor Agent ([@cursoragent](https://github.com/cursoragent))
|
|
10
|
+
- Jonathan Kingston ([@jonathanKingston](https://github.com/jonathanKingston))
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
1
14
|
# v14.95.0 (Sat Jun 13 2026)
|
|
2
15
|
|
|
3
16
|
#### 🚀 Enhancement
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duckduckgo/autoconsent",
|
|
3
|
-
"version": "14.95.
|
|
3
|
+
"version": "14.95.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"types": "./dist/types/web.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"esbuild": "^0.28.0",
|
|
73
73
|
"eslint": "^10.0.3",
|
|
74
74
|
"globals": "^17.4.0",
|
|
75
|
+
"jsonc-parser": "^3.3.1",
|
|
75
76
|
"markdown-it": "^14.0.0",
|
|
76
77
|
"mocha": "^11.0.1",
|
|
77
78
|
"prettier": "3.8.3",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import {
|
|
3
|
+
import { applyEdits, modify, parse, type JSONPath } from 'jsonc-parser';
|
|
4
|
+
import { encodeRules, type IndexedCMPRuleset } from '../lib/encoding';
|
|
4
5
|
|
|
5
6
|
if (process.argv.length !== 3) {
|
|
6
7
|
console.log('Usage: npm run bundle-config-rules path/to/privacy-configuration');
|
|
@@ -15,19 +16,24 @@ const bundleLocations = [path.join(privacyConfigPath, 'features', 'autoconsent.j
|
|
|
15
16
|
const autoconsentRules = JSON.parse(fs.readFileSync(path.join(__dirname, '../rules/rules.json'), 'utf-8')).autoconsent;
|
|
16
17
|
|
|
17
18
|
for (const location of bundleLocations) {
|
|
18
|
-
|
|
19
|
+
// privacy-configuration source files may contain comments (JSONC). Parse
|
|
20
|
+
// leniently and apply a targeted edit so comments and formatting survive.
|
|
21
|
+
const text = fs.readFileSync(location, 'utf-8');
|
|
22
|
+
const config = parse(text);
|
|
23
|
+
let rulePath: JSONPath;
|
|
24
|
+
let newCompactRuleList: IndexedCMPRuleset;
|
|
19
25
|
if (location.endsWith('autoconsent.json')) {
|
|
20
26
|
console.log(`Existing compact rule list: ${config.settings.compactRuleList.s.slice(0, 10)}`);
|
|
21
27
|
// global config
|
|
22
|
-
|
|
28
|
+
newCompactRuleList = encodeRules(autoconsentRules, config.settings.compactRuleList);
|
|
29
|
+
rulePath = ['settings', 'compactRuleList'];
|
|
23
30
|
} else {
|
|
24
31
|
// platform override
|
|
25
|
-
config.features.autoconsent.settings.compactRuleList
|
|
26
|
-
|
|
27
|
-
config.features.autoconsent.settings.compactRuleList,
|
|
28
|
-
);
|
|
32
|
+
newCompactRuleList = encodeRules(autoconsentRules, config.features.autoconsent.settings.compactRuleList);
|
|
33
|
+
rulePath = ['features', 'autoconsent', 'settings', 'compactRuleList'];
|
|
29
34
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
const edits = modify(text, rulePath, newCompactRuleList, {
|
|
36
|
+
formattingOptions: { tabSize: 4, insertSpaces: true },
|
|
37
|
+
});
|
|
38
|
+
fs.writeFileSync(location, applyEdits(text, edits));
|
|
33
39
|
}
|