Skip to content

Commit 2d3bdfc

Browse files
committed
Merge remote-tracking branch 'origin/v4.0' into dependabot/npm_and_yarn/stackgl_modules/npm_and_yarn-3fc01a8ecb
2 parents be4becb + e82d221 commit 2d3bdfc

327 files changed

Lines changed: 25427 additions & 15550 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ Before opening a pull request, developer should:
1818
7. select the _Allow edits from maintainers_ option (see this [article](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) for more details).
1919

2020
After opening a pull request, developer:
21-
- should create a new small markdown log file using the PR number e.g. `1010_fix.md` or `1010_add.md` inside `draftlogs` folder as described in this [README](https://github.com/plotly/plotly.js/blob/master/draftlogs/README.md), commit it and push.
21+
- should create a new small markdown log file using the PR number e.g. `1010_fix.md` or `1010_add.md` inside `draftlogs` folder as described in this [README](https://github.com/plotly/plotly.js/blob/master/draftlogs/README.md), commit it and push. A CI check enforces this; PRs that don't warrant a CHANGELOG entry can opt out by applying the `no-draftlog` label.
2222
- should **not** force push (i.e. `git push -f`) to remote branches associated with opened pull requests. Force pushes make it hard for maintainers to keep track of updates. Therefore, if required, please fetch `upstream/master` and "merge" with master instead of "rebase".

.github/actions/setup-workspace/action.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
name: 'Setup Workspace'
22
description: 'Setup Node.js, install dependencies, and download build artifacts'
33

4-
inputs:
5-
node-version:
6-
description: 'Node.js version to use'
7-
default: '18'
8-
94
runs:
105
using: 'composite'
116
steps:
127
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
138
with:
14-
node-version: ${{ inputs.node-version }}
9+
node-version-file: '.nvmrc'
1510
cache: 'npm'
1611

1712
- name: Install dependencies
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Check Draftlog
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, labeled, unlabeled, ready_for_review]
6+
7+
concurrency:
8+
group: check-draftlog-${{ github.event.pull_request.number }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
pull-requests: read
14+
15+
jobs:
16+
check-draftlog:
17+
if: github.event.pull_request.draft == false
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check for no-draftlog label
21+
id: label-check
22+
env:
23+
PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
24+
run: |
25+
set -euo pipefail
26+
if echo "$PR_LABELS" | grep -q '"no-draftlog"'; then
27+
echo "Skipping draftlog check: 'no-draftlog' label is set."
28+
echo "skip=true" >> "$GITHUB_OUTPUT"
29+
fi
30+
31+
- name: Check for a new draftlog entry
32+
if: steps.label-check.outputs.skip != 'true'
33+
env:
34+
GH_TOKEN: ${{ github.token }}
35+
REPO: ${{ github.repository }}
36+
PR_NUMBER: ${{ github.event.pull_request.number }}
37+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
38+
run: |
39+
set -euo pipefail
40+
41+
ADDED=$(gh api --paginate "/repos/$REPO/pulls/$PR_NUMBER/files" \
42+
--jq '.[] | select(.status=="added") | .filename' \
43+
| grep '^draftlogs/' | grep -v '^draftlogs/README\.md$' || true)
44+
45+
if [ -z "$ADDED" ]; then
46+
echo "::error::No new draftlog entry was added under draftlogs/."
47+
echo ""
48+
echo "Most PRs should add a markdown file under draftlogs/ for the next CHANGELOG."
49+
echo "See draftlogs/README.md for the filename convention."
50+
echo ""
51+
echo "If this PR genuinely does not need a changelog entry (e.g. CI-only,"
52+
echo "internal refactor, docs typo), add the 'no-draftlog' label to this PR."
53+
exit 1
54+
fi
55+
56+
INVALID_NAMES=$(echo "$ADDED" | grep -vE '^draftlogs/[0-9]+_(fix|add|remove|change|deprecate)\.md$' || true)
57+
if [ -n "$INVALID_NAMES" ]; then
58+
echo "::error::Invalid draftlog filename(s):"
59+
echo "$INVALID_NAMES" | sed 's/^/ - /'
60+
echo ""
61+
echo "Expected pattern: draftlogs/<number>_(fix|add|remove|change|deprecate).md"
62+
echo "See draftlogs/README.md for details."
63+
exit 1
64+
fi
65+
66+
MISSING_LINK=""
67+
while IFS= read -r f; do
68+
[ -z "$f" ] && continue
69+
content=$(gh api -H 'Accept: application/vnd.github.raw' "/repos/$REPO/contents/$f?ref=$HEAD_SHA")
70+
if ! echo "$content" | grep -qE '\[\[#[0-9]+\]\(https://github\.com/plotly/plotly\.js/pull/[0-9]+\)\]'; then
71+
MISSING_LINK="$MISSING_LINK$f"$'\n'
72+
fi
73+
done <<< "$ADDED"
74+
75+
if [ -n "$MISSING_LINK" ]; then
76+
echo "::error::Draftlog entry(ies) missing a PR link:"
77+
printf '%s' "$MISSING_LINK" | sed 's/^/ - /'
78+
echo ""
79+
echo "Each entry must include a link in the form:"
80+
echo " [[#1234](https://github.com/plotly/plotly.js/pull/1234)]"
81+
echo "See draftlogs/README.md for an example."
82+
exit 1
83+
fi
84+
85+
echo "Found new draftlog entry(ies):"
86+
echo "$ADDED" | sed 's/^/ - /'

.github/workflows/ci.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ concurrency:
1414
group: ci-${{ github.event.pull_request.number || github.ref }}
1515
cancel-in-progress: true
1616

17-
env:
18-
NODE_VERSION: '18'
19-
2017
jobs:
2118
detect-changes:
2219
runs-on: ubuntu-latest
@@ -60,7 +57,7 @@ jobs:
6057

6158
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
6259
with:
63-
node-version: ${{ env.NODE_VERSION }}
60+
node-version-file: '.nvmrc'
6461
cache: 'npm'
6562

6663
- name: Install dependencies
@@ -270,7 +267,7 @@ jobs:
270267
chrome-version: 'stable'
271268

272269
- name: Run noCI tests
273-
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
270+
uses: ./.github/actions/run-xvfb
274271
with:
275272
run: ./tasks/noci_test.sh jasmine
276273

@@ -579,6 +576,26 @@ jobs:
579576
- name: Run syntax tests on source files
580577
run: .github/scripts/test.sh source-syntax
581578

579+
typecheck:
580+
needs: install-and-cibuild
581+
runs-on: ubuntu-latest
582+
steps:
583+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
584+
- uses: ./.github/actions/setup-workspace
585+
586+
- name: Type-check TypeScript sources
587+
run: npm run typecheck
588+
589+
generated-types-drift:
590+
needs: install-and-cibuild
591+
runs-on: ubuntu-latest
592+
steps:
593+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
594+
- uses: ./.github/actions/setup-workspace
595+
596+
- name: Verify generated types are in sync with schema
597+
run: npm run schema-typegen-diff-check
598+
582599
# ============================================================
583600
# Standalone jobs (no dependencies on install-and-cibuild)
584601
# ============================================================
@@ -593,7 +610,7 @@ jobs:
593610

594611
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
595612
with:
596-
node-version: ${{ env.NODE_VERSION }}
613+
node-version-file: '.nvmrc'
597614
cache: 'npm'
598615

599616
- name: Set up build environment
@@ -624,7 +641,7 @@ jobs:
624641

625642
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
626643
with:
627-
node-version: ${{ env.NODE_VERSION }}
644+
node-version-file: '.nvmrc'
628645
cache: 'npm'
629646

630647
- name: Set up build environment

.github/workflows/publish-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
2727
with:
28-
node-version: '22.14.0'
28+
node-version-file: '.nvmrc'
2929
cache: 'npm'
3030

3131
- name: Set up build environment

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ build/*
77
dist/*.LICENSE.txt
88
dist/*.css
99

10+
# Ignore local dev mocks/baselines
11+
test/image/**/dev_*.*
12+
1013
npm-debug.log*
1114
*.sublime*
1215
*~
@@ -16,3 +19,4 @@ tags
1619
!.github/
1720
!.gitignore
1821
!.npmignore
22+
!.nvmrc

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.23.0

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ We use the following [labels](https://github.com/plotly/plotly.js/labels) to tra
7171
| `status: in progress` | PRs that required some initial feedback but not ready to merge |
7272
| `status: reviewable` | PRs that are completed from the author's perspective |
7373
| `status: on hold` | PRs that are put on hold |
74+
| `no-draftlog` | PR opted out of the [draftlog](./draftlogs/README.md) check |
7475

7576
## Development
7677

7778
#### Prerequisites
7879

7980
- git
80-
- [node.js](https://nodejs.org/en/). We recommend using node.js v18.x.
81+
- [node.js](https://nodejs.org/en/). We recommend using node.js v22.x.
8182
Upgrading and managing node versions can be easily done using
8283
[`nvm`](https://github.com/nvm-sh/nvm) or its Windows alternatives.
8384
- [`npm`](https://www.npmjs.com/) v10.x and up to ensure that the

CUSTOM_BUNDLE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Make sure you have the versions of node/npm that's recommended:
55
- plotly.js before 2.5: Node 12/npm 6
66
- plotly.js from 2.5: Node 16/npm 8
77
- plotly.js from 2.35: Node 18/npm 10
8+
- plotly.js from 4.0: Node 22/npm 10
89

9-
To download a specific node version look [here](https://nodejs.org/en/download/package-manager).
10+
To download a specific node version look [here](https://nodejs.org/en/download).
1011

1112
Note: For CI, it's faster to do `git clone --depth 1` to only get one commit.
1213

build/plotcss.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ var rules = {
5050
"X [data-title]:after": "content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;",
5151
"X .vertical [data-title]:before,X .vertical [data-title]:after": "top:0%;right:200%;",
5252
"X .vertical [data-title]:before": "border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",
53+
"X .plotly-cloud-dialog": "font-family:\"Open Sans\",verdana,arial,sans-serif;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1001;display:flex;align-items:center;justify-content:center;background-color:rgba(0,0,0,.4);",
54+
"X .plotly-cloud-dialog .plotly-cloud-dialog-box": "box-sizing:border-box;min-width:300px;max-width:420px;padding:20px 24px;background-color:#fff;border:1px solid #e0e2e5;border-radius:4px;box-shadow:0 4px 16px rgba(0,0,0,.25);font-size:13px;color:#2a3f5f;",
55+
"X .plotly-cloud-dialog .plotly-cloud-dialog-title": "font-size:16px;font-weight:bold;margin-bottom:12px;",
56+
"X .plotly-cloud-dialog .plotly-cloud-dialog-message": "line-height:1.5;overflow-wrap:break-word;word-wrap:break-word;",
57+
"X .plotly-cloud-dialog .plotly-cloud-dialog-buttons": "display:flex;justify-content:flex-end;margin-top:20px;",
58+
"X .plotly-cloud-dialog .plotly-cloud-dialog-btn": "font-family:inherit;font-size:13px;padding:7px 16px;margin-left:8px;border-radius:3px;border:1px solid rgba(0,0,0,0);cursor:pointer;",
59+
"X .plotly-cloud-dialog .plotly-cloud-dialog-btn:focus-visible": "outline:2px solid #447adb;outline-offset:1px;",
60+
"X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel": "background-color:#fff;border-color:#e0e2e5;color:#777;",
61+
"X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel:hover": "background-color:#f3f3f3;",
62+
"X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm": "background-color:#447adb;color:#fff;",
63+
"X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm:hover": "background-color:#1d3b84;",
5364
Y: "font-family:\"Open Sans\",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;",
5465
"Y p": "margin:0;",
5566
"Y .notifier-note": "min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;",

0 commit comments

Comments
 (0)