@duckduckgo/autoconsent 10.14.0 β†’ 10.16.0

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.
Files changed (56) hide show
  1. package/.eslintrc +1 -0
  2. package/.github/workflows/checks.yml +4 -5
  3. package/.github/workflows/release.yml +2 -2
  4. package/CHANGELOG.md +46 -0
  5. package/build.sh +0 -1
  6. package/ci/asana-create-tasks.js +5 -2
  7. package/ci/asana-update-tasks.js +1 -1
  8. package/data/coverage.json +1024 -1038
  9. package/dist/addon-firefox/background.bundle.js +8 -7
  10. package/dist/addon-firefox/content.bundle.js +50 -7
  11. package/dist/addon-firefox/manifest.json +1 -1
  12. package/dist/addon-firefox/rules.json +316 -47
  13. package/dist/addon-mv3/background.bundle.js +8 -7
  14. package/dist/addon-mv3/content.bundle.js +50 -7
  15. package/dist/addon-mv3/devtools/bulma.min.css +3 -1
  16. package/dist/addon-mv3/manifest.json +1 -1
  17. package/dist/addon-mv3/popup.bundle.js +1 -1
  18. package/dist/addon-mv3/rules.json +316 -47
  19. package/dist/autoconsent.cjs.js +50 -7
  20. package/dist/autoconsent.esm.js +50 -7
  21. package/dist/autoconsent.playwright.js +1 -1
  22. package/lib/cmps/admiral.ts +51 -0
  23. package/lib/cmps/all.ts +2 -0
  24. package/lib/dom-actions.ts +1 -1
  25. package/lib/eval-snippets.ts +4 -0
  26. package/package.json +14 -11
  27. package/playwright/runner.ts +1 -1
  28. package/rules/autoconsent/aa.json +32 -0
  29. package/rules/autoconsent/abc.json +33 -0
  30. package/rules/autoconsent/aliexpress.json +25 -15
  31. package/rules/autoconsent/dan-com.json +29 -0
  32. package/rules/autoconsent/ens-notify-banner.json +1 -1
  33. package/rules/autoconsent/medium.json +31 -0
  34. package/rules/autoconsent/nike.json +32 -0
  35. package/rules/autoconsent/openai.json +33 -0
  36. package/rules/autoconsent/temu.json +8 -6
  37. package/rules/autoconsent/tesla.json +35 -0
  38. package/rules/autoconsent/twcc.json +36 -0
  39. package/rules/rules.json +316 -47
  40. package/tests/aa.spec.ts +5 -0
  41. package/tests/abc.spec.ts +5 -0
  42. package/tests/admiral.spec.ts +8 -0
  43. package/tests/dan-com.spec.ts +5 -0
  44. package/tests/medium.spec.ts +5 -0
  45. package/tests/nike.spec.ts +5 -0
  46. package/tests/openai.spec.ts +5 -0
  47. package/tests/tesla.spec.ts +5 -0
  48. package/tests/twcc.spec.ts +5 -0
  49. package/tests-wtr/dom-actions/dom-actions.click.html +20 -0
  50. package/tests-wtr/dom-actions/dom-actions.click.ts +118 -0
  51. package/web-test-runner.config.mjs +16 -0
  52. package/dist/autoconsent.unit.js +0 -12571
  53. package/playwright/unit.ts +0 -15
  54. package/rules/autoconsent/generic-cosmetic.json +0 -9
  55. package/tests/dom-actions.spec.ts +0 -83
  56. package/tests/generic-cosmetic.spec.ts +0 -11
package/.eslintrc CHANGED
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "rules": {
18
18
  "@typescript-eslint/no-explicit-any": 0,
19
+ "@typescript-eslint/no-unused-expressions": 0,
19
20
  "indent": ["error", 2, { "SwitchCase": 1 }]
20
21
  }
21
22
  }
@@ -8,10 +8,10 @@ jobs:
8
8
  steps:
9
9
  - uses: actions/checkout@v3
10
10
 
11
- - name: Use Node.js 16.x
11
+ - name: Use Node.js 18.x
12
12
  uses: actions/setup-node@v3
13
13
  with:
14
- node-version: 16.x
14
+ node-version: 18.x
15
15
  cache: 'npm'
16
16
 
17
17
  - run: npm ci
@@ -22,11 +22,10 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  steps:
24
24
  - uses: actions/checkout@v3
25
- - name: Use Node.js 16.x
25
+ - name: Use Node.js 18.x
26
26
  uses: actions/setup-node@v3
27
27
  with:
28
- node-version: 16.x
28
+ node-version: 18.x
29
29
  cache: 'npm'
30
30
  - run: npm ci
31
- - run: npx playwright install --with-deps
32
31
  - run: npm run test:lib
@@ -15,10 +15,10 @@ jobs:
15
15
  - name: Prepare repository
16
16
  run: git fetch --unshallow --tags
17
17
 
18
- - name: Use Node.js 16.x
18
+ - name: Use Node.js 18.x
19
19
  uses: actions/setup-node@v3
20
20
  with:
21
- node-version: 16.x
21
+ node-version: 18.x
22
22
 
23
23
  - name: Create Release
24
24
  env:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,49 @@
1
+ # v10.16.0 (Tue Oct 15 2024)
2
+
3
+ #### πŸš€ Enhancement
4
+
5
+ - Update dependencies [#494](https://github.com/duckduckgo/autoconsent/pull/494) ([@muodov](https://github.com/muodov))
6
+ - Add rule for openai [#489](https://github.com/duckduckgo/autoconsent/pull/489) ([@muodov](https://github.com/muodov))
7
+
8
+ #### πŸ§ͺ Tests
9
+
10
+ - #333 Convert DomActions playwright-based unit test to WebTestRunner HTML test [#491](https://github.com/duckduckgo/autoconsent/pull/491) (frei.ondrej@pm.me [@freiondrej](https://github.com/freiondrej))
11
+
12
+ #### Authors: 3
13
+
14
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
15
+ - OndΕ™ej Frei ([@freiondrej](https://github.com/freiondrej))
16
+ - ondrej.frei (frei.ondrej@pm.me)
17
+
18
+ ---
19
+
20
+ # v10.15.0 (Mon Aug 19 2024)
21
+
22
+ #### πŸš€ Enhancement
23
+
24
+ - Tweak ensighten rule for britishairways.com [#488](https://github.com/duckduckgo/autoconsent/pull/488) ([@muodov](https://github.com/muodov))
25
+ - Add a rule for admiral GDPR popups [#487](https://github.com/duckduckgo/autoconsent/pull/487) ([@muodov](https://github.com/muodov))
26
+ - Add rule for tesla [#486](https://github.com/duckduckgo/autoconsent/pull/486) ([@muodov](https://github.com/muodov))
27
+ - Add rule for american airlines [#485](https://github.com/duckduckgo/autoconsent/pull/485) ([@muodov](https://github.com/muodov))
28
+ - Aliexpress & temu [#484](https://github.com/duckduckgo/autoconsent/pull/484) ([@muodov](https://github.com/muodov))
29
+ - Add a rule for abc.net.au [#482](https://github.com/duckduckgo/autoconsent/pull/482) ([@muodov](https://github.com/muodov))
30
+ - add rule for medium.com [#481](https://github.com/duckduckgo/autoconsent/pull/481) ([@muodov](https://github.com/muodov))
31
+ - Rule for Dan.com [#480](https://github.com/duckduckgo/autoconsent/pull/480) ([@muodov](https://github.com/muodov))
32
+ - Add a rule for nike [#479](https://github.com/duckduckgo/autoconsent/pull/479) ([@muodov](https://github.com/muodov))
33
+ - Add a rule for wise.com [#478](https://github.com/duckduckgo/autoconsent/pull/478) ([@muodov](https://github.com/muodov))
34
+
35
+ #### πŸ› Bug Fix
36
+
37
+ - Monthly Coverage data update [#477](https://github.com/duckduckgo/autoconsent/pull/477) (dax@duckduckgo.com [@sammacbeth](https://github.com/sammacbeth))
38
+
39
+ #### Authors: 3
40
+
41
+ - Dax the Deployer (dax@duckduckgo.com)
42
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
43
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
44
+
45
+ ---
46
+
1
47
  # v10.14.0 (Wed Aug 07 2024)
2
48
 
3
49
  #### πŸš€ Enhancement
package/build.sh CHANGED
@@ -4,7 +4,6 @@ set -ex
4
4
  ESBUILD="node_modules/.bin/esbuild --bundle"
5
5
 
6
6
  $ESBUILD --format=iife --target=es2021 --minify playwright/content.ts --outfile=dist/autoconsent.playwright.js
7
- $ESBUILD --format=iife --target=es2021 playwright/unit.ts --outfile=dist/autoconsent.unit.js
8
7
  $ESBUILD --format=esm --target=es2021 lib/web.ts --outfile=dist/autoconsent.esm.js
9
8
  $ESBUILD --format=cjs --target=es2021 --platform=node lib/web.ts --outfile=dist/autoconsent.cjs.js
10
9
 
@@ -71,7 +71,7 @@ const duplicateTemplateTask = (templateTaskGid) => {
71
71
  }
72
72
 
73
73
  const waitForJobSuccess = async (job_gid, attempts = 1) => {
74
- const interval = 500
74
+ const interval = 1000
75
75
  const maxAttempts = 20
76
76
 
77
77
  return new Promise(async (resolve, reject) => {
@@ -82,7 +82,9 @@ const waitForJobSuccess = async (job_gid, attempts = 1) => {
82
82
  attempts += 1
83
83
 
84
84
  if (attempts > maxAttempts) {
85
- return reject(new Error(`The job ${job_gid} took too long to execute`))
85
+ const errMsg = `The job ${job_gid} took too long to execute`
86
+ console.error(errMsg)
87
+ return reject(new Error(errMsg))
86
88
  }
87
89
 
88
90
  await timersPromises.setTimeout(interval)
@@ -175,6 +177,7 @@ asanaCreateTasks()
175
177
  console.log(result.stdout)
176
178
  })
177
179
  .catch((e) => {
180
+ console.error('Failed to create asana tasks:', result.stdout)
178
181
  // The Asana API returns errors in e.value.errors. If that's undefined log whatever else we got
179
182
  console.error(e.value?.errors || e)
180
183
  process.exit(1)
@@ -25,7 +25,7 @@ const asanaUpdateTasks = async () => {
25
25
  try {
26
26
  asanaOutput = JSON.parse(asanaOutputRaw || '')
27
27
  } catch (e) {
28
- throw new Error('Unable to parse Asana output JSON')
28
+ throw new Error(`Unable to parse Asana output JSON: ${asanaOutputRaw}`)
29
29
  }
30
30
 
31
31
  setupAsana()