diff --git a/.github/workflows/code-static-analysis.yml b/.github/workflows/code-static-analysis.yml index e6cfee631c6..16e644b2667 100644 --- a/.github/workflows/code-static-analysis.yml +++ b/.github/workflows/code-static-analysis.yml @@ -33,11 +33,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.12 if: ${{ matrix.language == 'python' }} uses: actions/setup-python@v5.1.1 with: - python-version: '3.8' + python-version: '3.12' - name: Install dependencies if: ${{ matrix.language == 'python' }} run: | diff --git a/.github/workflows/lintsql.yml b/.github/workflows/lintsql.yml index 1763c0492e5..a748871fd2f 100644 --- a/.github/workflows/lintsql.yml +++ b/.github/workflows/lintsql.yml @@ -18,10 +18,10 @@ jobs: with: # Full git history is needed to get a proper list of changed files within `super-linter` fetch-depth: 0 - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v5.1.1 with: - python-version: '3.8' + python-version: '3.12' - name: Lint SQL code if: | github.event_name == 'workflow_dispatch' || diff --git a/.github/workflows/predeploy.yml b/.github/workflows/predeploy.yml index ae429d25a9f..83db3b6f13c 100644 --- a/.github/workflows/predeploy.yml +++ b/.github/workflows/predeploy.yml @@ -36,10 +36,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v5.1.1 with: - python-version: '3.8' + python-version: '3.12' - name: Install Asian Fonts if: ${{ github.event.inputs.ebooks == 'true' }} run: | diff --git a/.github/workflows/test_website.yml b/.github/workflows/test_website.yml index aaeb011bc66..3662471e1d3 100644 --- a/.github/workflows/test_website.yml +++ b/.github/workflows/test_website.yml @@ -29,10 +29,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v5.1.1 with: - python-version: '3.8' + python-version: '3.12' - name: Run the website run: ./src/tools/scripts/run_and_test_website.sh - name: Remove node modules to avoid linting errors diff --git a/src/Dockerfile b/src/Dockerfile index 446d90e3547..17eb8287572 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,10 +1,10 @@ -ARG PYVER=3.8 +ARG PYVER=3.12 FROM python:${PYVER} as base # Enable unbuffered STDOUT logging ENV PYTHONUNBUFFERED=1 -ARG NODEVER=16.x +ARG NODEVER=20.x RUN curl -sL https://deb.nodesource.com/setup_${NODEVER} | bash - RUN apt update && apt install -y nodejs && rm -rf /var/lib/apt/lists/* \ diff --git a/src/README.md b/src/README.md index c86bd4b5d86..f1c70b23fe8 100644 --- a/src/README.md +++ b/src/README.md @@ -1,6 +1,6 @@ # Developing the Web Almanac -The Web Almanac can be developed on macOS, Windows or Linux. It requires Node v16, Python v3.8 and pip to be installed. You can use Docker to avoid manually configuring the development environment. +The Web Almanac can be developed on macOS, Windows or Linux. It requires Node v20, Python v3.12 and pip to be installed. You can use Docker to avoid manually configuring the development environment. It can be quickly deployed as a development container in GitHub Codespaces to develop in cloud: [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/HTTPArchive/almanac.httparchive.org?quickstart=1) @@ -14,7 +14,7 @@ An `.editorconfig` file exists for those using [EditorConfig](https://editorconf Make sure you run the following commands from within the `src` directory by executing `cd src` first. -Make sure Python (3.8 or above), pip and NodeJS (v20 or above) are installed on your machine. +Make sure Python (3.12 or above), pip and NodeJS (v20 or above) are installed on your machine. 1. If you don't have virtualenv, install it using pip. @@ -31,7 +31,7 @@ py -m pip install --user virtualenv 2. Create an isolated Python environment, and install dependencies: ``` -virtualenv --python python3.8 .venv +virtualenv --python python3.12 .venv source .venv/bin/activate ``` @@ -49,7 +49,7 @@ npm install npm run start ``` -4. In your web browser, enter the following address: http://127.0.0.1:8080 +4. In your web browser, enter the following address: To stop the server run the following: @@ -164,9 +164,9 @@ Generating for chapter: pwa for year 2021 Authors can delete images and rerun if they want to, to regenerate images. -Images will automatically be compressed by our Calibre GitHub Action when uploaded to GitHub, but you can get a lot more compression (about 44% more!) by running them through https://tinypng.com instead (at which point the Calibre Action will usually not find any further compression gains). It's quite simple to drag them up, and download them, so would encourage analysts/authors to take this step. +Images will automatically be compressed by our Calibre GitHub Action when uploaded to GitHub, but you can get a lot more compression (about 44% more!) by running them through instead (at which point the Calibre Action will usually not find any further compression gains). It's quite simple to drag them up, and download them, so would encourage analysts/authors to take this step. -Running them through https://tinypng.com also has the added advantage of the compression being repeatable each time. So if you are not sure which images you have changed, you can delete them all, regenerate them all, run them through TinyPNG, and then a `git diff` will only show differences on the images that have changed. This will not be the case if you use the Calibre GitHub Action and it will look like all images have changed. +Running them through also has the added advantage of the compression being repeatable each time. So if you are not sure which images you have changed, you can delete them all, regenerate them all, run them through TinyPNG, and then a `git diff` will only show differences on the images that have changed. This will not be the case if you use the Calibre GitHub Action and it will look like all images have changed. ## Linting files @@ -214,6 +214,7 @@ All Finished 📜 🎉! ``` This states that: + - On line 25, in position 26 you are using lowercase for keywords (e.g. `as` instead of `AS`) so failed rule L010. - Similarly on line 26, position 37. - And finally on line 34, position 63 you have an unnecessary comma (e.g. `SELECT a,b, FROM table`) and so failed rule L038. Remove the extra comma. @@ -244,7 +245,6 @@ Are you sure you wish to attempt to fix these? [Y/n] If you lint again you should see most of the errors are fixed. Note that not all errors can be autofixed and some will require manual intervention but autofixing is useful for the simple errors. So while it's generally OK to run the `fix` command, do run the `lint` command when all clean to make sure the `fix` command didn't miss any issues. - ## Generating Ebooks For generating PDFs of the ebook, you need to install Prince. Follow the instructions on [the Prince Website](https://www.princexml.com/) and pdftk. @@ -318,7 +318,7 @@ prince "http://127.0.0.1:8080/en/2019/ebook?cover&spine=25&pageWidth=148&pageHei Note, similar to above, this will create one extra page at the begining which will need to be removed with a PDF editor to start with a clean page for printing. Please remove this before checking in versions into git. -With the print-ready eBook and Cover you can send them to a printer. I used https://www.digitalprintingireland.ie/ before and they were excellent and charge about €35 for a full-colour A5 ebook. Most of the settings above are for them, so tweak them based on your own printer's requirements. +With the print-ready eBook and Cover you can send them to a printer. I used before and they were excellent and charge about €35 for a full-colour A5 ebook. Most of the settings above are for them, so tweak them based on your own printer's requirements. ## Deploying changes @@ -360,13 +360,14 @@ npm run stage -- -s 20211111t105151 To deploy the site to production run the following: -_Make sure you have updated the timestamps and generated the ebooks PDFs first in the main branch, by running the "Predeploy script" GitHub Action_ +*Make sure you have updated the timestamps and generated the ebooks PDFs first in the main branch, by running the "Predeploy script" GitHub Action* ``` npm run deploy ``` The deploy script will do the following: + - Ask you to confirm you've run the pre-deploy script via GitHub Actions - Switch to the production branch - Merge changes from main @@ -399,7 +400,7 @@ docker image build -t webalmanac . docker container run --rm -it -v "$PWD":/app -p 8080:8080 webalmanac ``` -3. Open http://localhost:8080 in your web browser to access the site. You can kill the server when it is no longer needed using `Ctrl+C`. +3. Open in your web browser to access the site. You can kill the server when it is no longer needed using `Ctrl+C`. 4. Make changes in the code using any text editor and run tests (need to build the image again if any Python or Node dependencies are changed): @@ -420,7 +421,7 @@ root@[CID]:/app# exit 6. To customize the image use `PYVER`, `NODEVER`, and `SKIPGC` build arguments to control which versions of Python and Node are used and whether Google Cloud SDK is installed. ``` -docker image build --build-arg PYVER=3.8 --build-arg NODEVER=14.x --build-arg SKIPGC=false -t webalmanac:custom . +docker image build --build-arg PYVER=3.12 --build-arg NODEVER=20.x --build-arg SKIPGC=false -t webalmanac:custom . ``` 7. If you want to run the GitHub Super-Linter without `npm` being installed you need to call the command directly as given in `package.json`. diff --git a/src/app.yaml b/src/app.yaml index 3c4b422c215..72b86609170 100644 --- a/src/app.yaml +++ b/src/app.yaml @@ -1,4 +1,4 @@ -runtime: python38 +runtime: python312 entrypoint: gunicorn -b :$PORT main:app default_expiration: 3h diff --git a/src/config/last_updated.json b/src/config/last_updated.json index 253c9c4fad3..4bb54272d07 100644 --- a/src/config/last_updated.json +++ b/src/config/last_updated.json @@ -31,8 +31,8 @@ }, "/static/js/almanac.js": { "date_published": "2021-02-24T00:00:00.000Z", - "date_modified": "2024-02-23T00:00:00.000Z", - "hash": "096e38f74c72532860651812978526c5" + "date_modified": "2024-08-29T00:00:00.000Z", + "hash": "97142d86390e2f961ce47183b6d3c9cb" }, "/static/js/send-web-vitals.js": { "date_published": "2021-02-24T00:00:00.000Z", diff --git a/src/package-lock.json b/src/package-lock.json index a773798e6ce..e14b6c26577 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -11,11 +11,11 @@ "devDependencies": { "ejs": "3.1.10", "fs-extra": "11.2.0", - "jsdom": "24.1.1", + "jsdom": "25.0.0", "node-fetch": "3.3.2", "node-watch": "0.7.4", "prettier": "3.3.3", - "puppeteer": "23.1.1", + "puppeteer": "23.2.0", "rainbow-code": "2.1.7", "recursive-readdir": "2.2.3", "run-script-os": "1.1.6", @@ -214,9 +214,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.4.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.4.2.tgz", - "integrity": "sha512-nAvM3Ey230/XzxtyDcJ+VjvlzpzoHwLsF7JaDRfoI0ytO0mVheerNmM45CtA0yOILXwXXxOrcUWH3wltX+7PSw==", + "version": "22.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.0.tgz", + "integrity": "sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==", "dev": true, "optional": true, "dependencies": { @@ -348,9 +348,9 @@ } }, "node_modules/bare-stream": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.1.3.tgz", - "integrity": "sha512-tiDAH9H/kP+tvNO5sczyn9ZAA7utrSMobyDchsnyyXBuUe2FSQWbxhtuHB8jwpHYYevVo2UJpcmvvjrbHboUUQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.2.0.tgz", + "integrity": "sha512-+o9MG5bPRRBlkVSpfFlMag3n7wMaIZb4YZasU2+/96f+3HTQ4F9DKQeu3K/Sjz1W0umu6xvVq1ON0ipWdMlr3A==", "dev": true, "optional": true, "dependencies": { @@ -634,9 +634,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1312386", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz", - "integrity": "sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==", + "version": "0.0.1330662", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1330662.tgz", + "integrity": "sha512-pzh6YQ8zZfz3iKlCvgzVCu22NdpZ8hNmwU6WnQjNVquh0A9iVosPtNLWDwaWVGyrntQlltPFztTMK5Cg6lfCuw==", "dev": true }, "node_modules/ejs": { @@ -1123,9 +1123,9 @@ "dev": true }, "node_modules/jsdom": { - "version": "24.1.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.1.tgz", - "integrity": "sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==", + "version": "25.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.0.tgz", + "integrity": "sha512-OhoFVT59T7aEq75TVw9xxEfkXgacpqAhQaYgP9y/fDqWQCMB/b1H66RfmPm/MaeaAIU9nDwMOVTlPN51+ao6CQ==", "dev": true, "dependencies": { "cssstyle": "^4.0.1", @@ -1471,17 +1471,17 @@ } }, "node_modules/puppeteer": { - "version": "23.1.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.1.1.tgz", - "integrity": "sha512-giN4Ikwl5hkkouH/dVyxIPTPslWuqZ8fjALdSw5Cvt+r0LuDpLdfPxRADlB75YJ2UjPZhgok+xYBYk8ffzv4MA==", + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.2.0.tgz", + "integrity": "sha512-MP7kLOdCfx1BJaGN5sgRo5fTYwAyGrlwWtrNphjKcwv/HO91+m90gbbwpRHbGl0rCvrmylq6vljn+zrjukniVg==", "dev": true, "hasInstallScript": true, "dependencies": { "@puppeteer/browsers": "2.3.1", "chromium-bidi": "0.6.4", "cosmiconfig": "^9.0.0", - "devtools-protocol": "0.0.1312386", - "puppeteer-core": "23.1.1", + "devtools-protocol": "0.0.1330662", + "puppeteer-core": "23.2.0", "typed-query-selector": "^2.12.0" }, "bin": { @@ -1492,15 +1492,15 @@ } }, "node_modules/puppeteer-core": { - "version": "23.1.1", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.1.1.tgz", - "integrity": "sha512-OeTqNiYGF9qZtwZU4Yc88DDqFJs4TJ4rnK81jkillh6MwDeQodyisM9xe5lBmPhwiDy92s5J5DQtQLjCKHFQ3g==", + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.2.0.tgz", + "integrity": "sha512-OFyPp2oolGSesx6ZrpmorE5tCaCKY1Z5e/h8f6sB0NpiezenB72jdWBdOrvBO/bUXyq14XyGJsDRUsv0ZOPdZA==", "dev": true, "dependencies": { "@puppeteer/browsers": "2.3.1", "chromium-bidi": "0.6.4", "debug": "^4.3.6", - "devtools-protocol": "0.0.1312386", + "devtools-protocol": "0.0.1330662", "typed-query-selector": "^2.12.0", "ws": "^8.18.0" }, @@ -1698,9 +1698,9 @@ "dev": true }, "node_modules/streamx": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.18.0.tgz", - "integrity": "sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.19.0.tgz", + "integrity": "sha512-5z6CNR4gtkPbwlxyEqoDGDmWIzoNJqCBt4Eac1ICP9YaIT08ct712cFj0u1rx4F8luAuL+3Qc+RFIdI4OX00kg==", "dev": true, "dependencies": { "fast-fifo": "^1.3.2", @@ -1832,9 +1832,9 @@ } }, "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true }, "node_modules/typed-query-selector": { @@ -2243,9 +2243,9 @@ "dev": true }, "@types/node": { - "version": "22.4.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.4.2.tgz", - "integrity": "sha512-nAvM3Ey230/XzxtyDcJ+VjvlzpzoHwLsF7JaDRfoI0ytO0mVheerNmM45CtA0yOILXwXXxOrcUWH3wltX+7PSw==", + "version": "22.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.0.tgz", + "integrity": "sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==", "dev": true, "optional": true, "requires": { @@ -2362,9 +2362,9 @@ } }, "bare-stream": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.1.3.tgz", - "integrity": "sha512-tiDAH9H/kP+tvNO5sczyn9ZAA7utrSMobyDchsnyyXBuUe2FSQWbxhtuHB8jwpHYYevVo2UJpcmvvjrbHboUUQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.2.0.tgz", + "integrity": "sha512-+o9MG5bPRRBlkVSpfFlMag3n7wMaIZb4YZasU2+/96f+3HTQ4F9DKQeu3K/Sjz1W0umu6xvVq1ON0ipWdMlr3A==", "dev": true, "optional": true, "requires": { @@ -2553,9 +2553,9 @@ "dev": true }, "devtools-protocol": { - "version": "0.0.1312386", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz", - "integrity": "sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==", + "version": "0.0.1330662", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1330662.tgz", + "integrity": "sha512-pzh6YQ8zZfz3iKlCvgzVCu22NdpZ8hNmwU6WnQjNVquh0A9iVosPtNLWDwaWVGyrntQlltPFztTMK5Cg6lfCuw==", "dev": true }, "ejs": { @@ -2905,9 +2905,9 @@ "dev": true }, "jsdom": { - "version": "24.1.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.1.tgz", - "integrity": "sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==", + "version": "25.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.0.tgz", + "integrity": "sha512-OhoFVT59T7aEq75TVw9xxEfkXgacpqAhQaYgP9y/fDqWQCMB/b1H66RfmPm/MaeaAIU9nDwMOVTlPN51+ao6CQ==", "dev": true, "requires": { "cssstyle": "^4.0.1", @@ -3168,29 +3168,29 @@ "dev": true }, "puppeteer": { - "version": "23.1.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.1.1.tgz", - "integrity": "sha512-giN4Ikwl5hkkouH/dVyxIPTPslWuqZ8fjALdSw5Cvt+r0LuDpLdfPxRADlB75YJ2UjPZhgok+xYBYk8ffzv4MA==", + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.2.0.tgz", + "integrity": "sha512-MP7kLOdCfx1BJaGN5sgRo5fTYwAyGrlwWtrNphjKcwv/HO91+m90gbbwpRHbGl0rCvrmylq6vljn+zrjukniVg==", "dev": true, "requires": { "@puppeteer/browsers": "2.3.1", "chromium-bidi": "0.6.4", "cosmiconfig": "^9.0.0", - "devtools-protocol": "0.0.1312386", - "puppeteer-core": "23.1.1", + "devtools-protocol": "0.0.1330662", + "puppeteer-core": "23.2.0", "typed-query-selector": "^2.12.0" } }, "puppeteer-core": { - "version": "23.1.1", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.1.1.tgz", - "integrity": "sha512-OeTqNiYGF9qZtwZU4Yc88DDqFJs4TJ4rnK81jkillh6MwDeQodyisM9xe5lBmPhwiDy92s5J5DQtQLjCKHFQ3g==", + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.2.0.tgz", + "integrity": "sha512-OFyPp2oolGSesx6ZrpmorE5tCaCKY1Z5e/h8f6sB0NpiezenB72jdWBdOrvBO/bUXyq14XyGJsDRUsv0ZOPdZA==", "dev": true, "requires": { "@puppeteer/browsers": "2.3.1", "chromium-bidi": "0.6.4", "debug": "^4.3.6", - "devtools-protocol": "0.0.1312386", + "devtools-protocol": "0.0.1330662", "typed-query-selector": "^2.12.0", "ws": "^8.18.0" } @@ -3338,9 +3338,9 @@ "dev": true }, "streamx": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.18.0.tgz", - "integrity": "sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.19.0.tgz", + "integrity": "sha512-5z6CNR4gtkPbwlxyEqoDGDmWIzoNJqCBt4Eac1ICP9YaIT08ct712cFj0u1rx4F8luAuL+3Qc+RFIdI4OX00kg==", "dev": true, "requires": { "bare-events": "^2.2.0", @@ -3452,9 +3452,9 @@ } }, "tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true }, "typed-query-selector": { diff --git a/src/package.json b/src/package.json index a553de250ce..4e7e6eb3ee2 100644 --- a/src/package.json +++ b/src/package.json @@ -37,11 +37,11 @@ "devDependencies": { "ejs": "3.1.10", "fs-extra": "11.2.0", - "jsdom": "24.1.1", + "jsdom": "25.0.0", "node-fetch": "3.3.2", "node-watch": "0.7.4", "prettier": "3.3.3", - "puppeteer": "23.1.1", + "puppeteer": "23.2.0", "rainbow-code": "2.1.7", "recursive-readdir": "2.2.3", "run-script-os": "1.1.6", diff --git a/src/static/js/almanac.js b/src/static/js/almanac.js index b722dcff4e8..b32745e1afd 100644 --- a/src/static/js/almanac.js +++ b/src/static/js/almanac.js @@ -426,6 +426,8 @@ function upgradeInteractiveFigures() { iframe.setAttribute('scrolling', fig_img.dataset.scrolling || 'no'); iframe.setAttribute('loading', fig_img.dataset.loading || 'lazy'); iframe.setAttribute('src', fig_img.dataset.iframe); + // Set it to credentialless to avoid issues when it tries to embed the login screen + iframe.setAttribute('credentialless', true); //The figure should have a link var parentLink = fig_img.parentNode; diff --git a/src/tools/scripts/deploy.sh b/src/tools/scripts/deploy.sh index 9a532f6ac7b..584105f37ce 100755 --- a/src/tools/scripts/deploy.sh +++ b/src/tools/scripts/deploy.sh @@ -102,7 +102,7 @@ git pull origin main if [ "$(pgrep -if 'python main.py')" ]; then echo "Killing existing server to run a fresh version" - pkill -9 python main.py + pkill -9 -if "python main.py" fi #Remove generated chapters and e-books (in case new one from other branch in there) @@ -190,7 +190,7 @@ git checkout main if [ "$(pgrep -if 'python main.py')" ]; then echo "Killing server so backgrounded version isn't left there" - pkill -9 -f "python main.py" + pkill -9 -if "python main.py" fi echo diff --git a/src/tools/scripts/run_and_test_website.bat b/src/tools/scripts/run_and_test_website.bat index 19dac43f05f..4472b82e75a 100644 --- a/src/tools/scripts/run_and_test_website.bat +++ b/src/tools/scripts/run_and_test_website.bat @@ -6,7 +6,7 @@ rem # This script installs all the required dependencies needed to run the rem # Web Almanac website providing you have python and node installed. rem # rem # It 's a simplified version of run_and_test_website.sh for windows users -rem # It depends on Python 3.8, pip and nodejs 12 being installed already +rem # It depends on Python 3.12, pip and nodejs 20 being installed already rem # echo "Kill any existing instances of the webserver" diff --git a/src/tools/scripts/run_and_test_website.sh b/src/tools/scripts/run_and_test_website.sh index 85c33f7592b..bedd2ea6caf 100755 --- a/src/tools/scripts/run_and_test_website.sh +++ b/src/tools/scripts/run_and_test_website.sh @@ -53,12 +53,12 @@ fi if [ "$(pgrep -if 'python main.py')" ]; then echo "Killing existing server to run a fresh version" - pkill -9 -f "python main.py" + pkill -9 -if "python main.py" fi if [ "$(pgrep -if 'node ./tools/generate/chapter_watcher')" ]; then echo "Killing existing watcher to run a fresh version" - pkill -9 -f "node ./tools/generate/chapter_watcher" + pkill -9 -if "node ./tools/generate/chapter_watcher" fi echo "Installing and testing python environment" @@ -105,7 +105,7 @@ if [ "${debug}" == "1" ]; then if [ "$(pgrep -if 'python main.py')" ]; then echo "Killing server to run a fresh version in debug mode" - pkill -9 -f "python main.py" + pkill -9 -if "python main.py" fi echo "Starting website in foreground mode so it reloads on file changes" diff --git a/src/tools/scripts/stop_website.sh b/src/tools/scripts/stop_website.sh index 28d572ae03b..518cb7e5738 100755 --- a/src/tools/scripts/stop_website.sh +++ b/src/tools/scripts/stop_website.sh @@ -9,7 +9,7 @@ # It is useful as sometimes these are backgrounded so this offers a quick way of stopping them. # -pkill -9 -f "python main.py" -pkill -9 -f "./tools/generate/chapter_watcher" +pkill -9 -if "python main.py" +pkill -9 -if "./tools/generate/chapter_watcher" exit 0