Skip to content

Commit

Permalink
Merge branch 'main' into jkt/addVersionStringForCSS
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanKingston committed Jul 28, 2023
2 parents d71377b + 5d4a64f commit c977a12
Show file tree
Hide file tree
Showing 300 changed files with 26,181 additions and 25,383 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"indent": ["error", 4],
"no-shadow": ["error"],
"no-restricted-syntax": [
"warn",
"error",
{
"selector": ":matches(ImportNamespaceSpecifier, ExportAllDeclaration, ExportNamespaceSpecifier)",
"message": "Prefer explicit named imports over wildcard (import * as x)"
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 20
target-branch: "main"
labels:
- "dependencies"
Expand Down
39 changes: 4 additions & 35 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Check

on:
push:
branches:
- main
branches: [ main ]
pull_request:

jobs:
Expand Down Expand Up @@ -31,7 +30,7 @@ jobs:
with:
node-version: ${{ matrix.version }}
cache: 'npm'
- run: npm run ${{ matrix.target }}
- run: npm run ${{ matrix.target }}

unit-tests:
runs-on: ubuntu-latest
Expand All @@ -44,38 +43,8 @@ jobs:
- run: npm run install-ci
- run: npm test

integration-tests:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm run install-ci
- run: npm run test-int
- name: Store test artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: integration-test-artifacts
path: integration-test/artifacts

integration-mv3-tests:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm run install-ci
- run: npm run test-int-mv3

playwright-tests:
timeout-minutes: 10
timeout-minutes: 14
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -96,7 +65,7 @@ jobs:
retention-days: 30

playwright-tests-mv3:
timeout-minutes: 10
timeout-minutes: 14
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ddg2dnr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ddg2dnr

on: [push, pull_request]
on: [ pull_request ]

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DS_Store
.vscode/
.vscode
*.pem
jshint_log.txt
node_modules
Expand Down
16 changes: 12 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ cd -
npm run bundle-config
```

### Updating the MV3 blocklists

Manifest v3 (MV3) builds of the extension contain bundled static declarativeNetRequest rulesets and corresponding block lists for Tracker Blocking. Both the default (aka current)
and a fallback blocklist are included. The fallback blocklist serves as a backup in case the current blocklist is catastrophically broken. To ensure that builds are reproducible,
the current and fallback blocklist versions are defined in `shared/data/etags.json`. The blocklists are fetched and rulesets generated automatically when the extension is built.

To update the blocklist versions, use the `npm run update-mv3-blocklists` command. Remember to then commit the changes to `shared/data/etags.json` and rebuild the extension.

**Note: The migration to static Tracker Blocking rulesets is in progress. They are not created or used, but will be soon.**

### Development flow

The `shared` directory contains JS, CSS, and images that are shared by all browsers for things like the options
Expand All @@ -84,7 +94,7 @@ page and the dev-tools panel.
The popup UI comes from [`@duckduckgo/privacy-dashboard`](https://github.com/duckduckgo/privacy-dashboard) - we use `npm`
to install this package. At build time we copy the pre-built assets from the Dashboard into the extensions output folder.
To make changes to the dashboard, see the section below [Locally testing changes to modules](#locally-testing-changes-to-modules).
The Dashboard also publishes extension-specific [documentation](https://duckduckgo.github.io/privacy-dashboard/example/docs/modules/Browser_Extensions_integration.html)
The Dashboard also publishes extension-specific [documentation](https://duckduckgo.github.io/privacy-dashboard/modules/Browser_Extensions_integration.html)

The background JS is in `shared/js/`

Expand Down Expand Up @@ -117,7 +127,5 @@ The extension imports several DDG-owned modules (see [package.json](https://gith
- TypeScript Linting: `npm run tsc`

### Testing
- Unit tests: `npm test`
- Unit tests: `npm test` (full docs [here](./unit-test/README.md))
- Integration tests: `npm run playwright` (full docs [here](./integration-test/README.md))
- Legacy integration tests: `npm run test-int`
- You can filter to one test with: `KEEP_OPEN=1 npm run test-int -- -f integration-test/background/test-fp-fingerprint.js`
Loading

0 comments on commit c977a12

Please sign in to comment.