Skip to content

Bump lodash from 4.17.21 to 4.18.1 in /js #828

Bump lodash from 4.17.21 to 4.18.1 in /js

Bump lodash from 4.17.21 to 4.18.1 in /js #828

Workflow file for this run

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'js/**'
- 'plotly/labextension/**'
name: Check JS build
permissions:
contents: read
jobs:
check-js-build:
name: Check JS version number and build artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.x"
- name: Check that version number for JS project matches version number for Python project
run: |
PYPROJECT_PATH="pyproject.toml"
PKGJSON_PATH="js/package.json"
PYPROJECT_VERSION=$(awk -F'"' '/^version/ {print $2; exit}' $PYPROJECT_PATH)
JSPROJECT_VERSION=$(cat $PKGJSON_PATH | jq -r '.version')
if [ "$PYPROJECT_VERSION" != "$JSPROJECT_VERSION" ]; then
echo "❌ Version number $JSPROJECT_VERSION in $PKGJSON_PATH does not match version number $PYPROJECT_VERSION in $PYPROJECT_PATH"
exit 1
else
echo "✅ Version number $JSPROJECT_VERSION in $PKGJSON_PATH matches version number $PYPROJECT_VERSION in $PYPROJECT_PATH"
fi
- name: Install Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '22'
- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Copy current files to a temporary directory
run: |
mv plotly/labextension/ plotly/labextension-tmp/
- name: Install dependencies and build
run: |
uv venv
source .venv/bin/activate
# Technically, we only need the `jupyter-builder` package, but using the dev_build extra
# keeps build behavior consistent across all CI jobs
uv sync --locked --extra dev_build
cd js
npm ci
npm run build
npm ls
- name: Check JupyterLab build artifacts
run: |
# Compare the plotly/labextension and plotly/labextension-tmp directories
diff -r --brief plotly/labextension/ plotly/labextension-tmp/ > labextension_diff.txt
# Check for differences
if [ -s labextension_diff.txt ]; then
echo "❌ Build artifacts differ:"
echo "--- Unexpected diffs ---"
cat labextension_diff.txt
echo "Please replace the 'plotly/labextension' directory with the artifacts of this CI run."
exit 1
else
echo "✅ Build artifacts match expected output"
fi
- name: Store the build artifacts from plotly/labextension
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: failure()
with:
name: labextension
path: plotly/labextension