Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Javascript rewriting: module detection + wombat JS URL rewriting / enhance Vimeo support #228

Merged
merged 21 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1c123d6
Enhance JS tests in test-website
benoit74 Apr 9, 2024
beca01c
Move JS code to dedicated JS module and generate all fuzzy rules
benoit74 Apr 9, 2024
f59b22c
Add more URL rewriting tests for Python
benoit74 Apr 11, 2024
7efd5ee
Fix url rewriting to support all test cases / weird URL encoding
benoit74 Apr 9, 2024
395ae95
Fix detection and rewriting of JS modules
benoit74 Mar 28, 2024
8a483dd
Adapt CI and README for javascript instructions
benoit74 Apr 11, 2024
0da0235
Fix Vimeo fuzzy rule
benoit74 Mar 28, 2024
c6c266c
Add support for situation where URL is already rewritten
benoit74 Apr 12, 2024
2add270
Add logging to debug
benoit74 Apr 12, 2024
3c5c46b
Add support for Vimeo preview image
benoit74 Apr 12, 2024
5b11aac
Add documentation for fuzzyrules generation and JS operations
benoit74 Apr 12, 2024
29dbc23
Add eslint and prettier for proper JS formatting
benoit74 Apr 12, 2024
31472e7
Fix JS template for fuzzy rules and ignore generated file
benoit74 Apr 12, 2024
434f511
Adapt Github workflows for fuzzy rules generation and JS QA/tests
benoit74 Apr 12, 2024
9b5fa41
Display missing ZIM item warnings only once in debug mode
benoit74 Apr 29, 2024
7c13f14
Also follow temporary redirects to find main path WARC item
benoit74 Apr 29, 2024
5a0b0e6
Small fixes following review
benoit74 Apr 29, 2024
d8afb49
Expand attributes for code clarity
benoit74 Apr 29, 2024
a0cfd98
Add documentation JS rewriting assumptions
benoit74 Apr 29, 2024
f2e4263
Reorganize code for clarity
benoit74 Apr 29, 2024
fe62acb
Manage already rewritten URL in dynamic JS URL rewriting
benoit74 Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/Publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ jobs:
python-version-file: pyproject.toml
architecture: x64

- name: Generate fuzzy rules
run: python rules/generate_rules.py

- name: Build Javascript wombatSetup.js
uses: addnab/docker-run-action@v3
with:
image: node:20-bookworm
options: -v ${{ github.workspace }}/src/warc2zim/statics:/output -v ${{ github.workspace }}/rules:/src/rules -v ${{ github.workspace }}/javascript:/src/javascript -v ${{ github.workspace }}/build_js.sh:/src/build_js.sh
run: |
/src/build_js.sh

- name: Build packages
run: |
pip install -U pip build
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/PublishDockerDevImage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Build Javascript wombatSetup.js
uses: addnab/docker-run-action@v3
with:
image: node:20-bookworm
options: -v ${{ github.workspace }}/src/warc2zim/statics:/output -v ${{ github.workspace }}/rules:/src/rules -v ${{ github.workspace }}/javascript:/src/javascript -v ${{ github.workspace }}/build_js.sh:/src/build_js.sh
run: |
/src/build_js.sh

- name: Build and push Docker image
uses: openzim/docker-publish-action@v10
with:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/QA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
pip install -U pip
pip install -e .[lint,scripts,test,check]

- name: Generate fuzzy rules
run: python rules/generate_rules.py

- name: Check black formatting
run: inv lint-black

Expand All @@ -32,3 +35,20 @@ jobs:

- name: Check pyright
run: inv check-pyright

- name: Set up Node.JS
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install JS dependencies
working-directory: javascript
run: yarn install

- name: Check prettier formatting
working-directory: javascript
run: yarn prettier-check

- name: Check eslint rules
working-directory: javascript
run: yarn eslint
24 changes: 24 additions & 0 deletions .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
pip install -U pip
pip install -e .[test,scripts]

- name: Generate fuzzy rules
run: python rules/generate_rules.py

- name: Run the tests
run: inv coverage --args "-vvv"

Expand All @@ -32,6 +35,19 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Set up Node.JS
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install JS dependencies
working-directory: javascript
run: yarn install

- name: Run JS tests
working-directory: javascript
run: yarn test

build_python:
runs-on: ubuntu-22.04
steps:
Expand All @@ -43,6 +59,14 @@ jobs:
python-version-file: pyproject.toml
architecture: x64

- name: Install dependencies (and project)
run: |
pip install -U pip build
pip install -e .

- name: Generate fuzzy rules
run: python rules/generate_rules.py

- name: Ensure we can build Python targets
run: |
pip install -U pip build
Expand Down
Loading
Loading