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

Merge branch 'master' into 'next' #19632

Merged
merged 206 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
c1a157e
WIP(ssr): add meta-data and test case #18334
Ovilia Mar 14, 2023
ed1c176
WIP
Ovilia Mar 21, 2023
8fb7ed0
Merge branch 'master' into ssr
Ovilia Mar 28, 2023
f8b25f5
style(ssr): remove console.log
Ovilia Mar 31, 2023
27cc769
test(ssr): add test cases
Ovilia Mar 31, 2023
77ef252
fix(axis): show last tick for single data #18453
Ovilia Apr 3, 2023
fa5dbd8
update `init` function type signature so it can be identical to document
zhuscat Apr 27, 2023
8b08773
Merge pull request #18575 from zhuscat/patch-1
plainheart Apr 28, 2023
bb403c1
test(pie): add a test case to cover #18412
plainheart May 6, 2023
41d906a
fix: typo in echarts.all.ts
kirklin May 11, 2023
9e5745a
Merge pull request #18613 from kirklin/master
plainheart May 11, 2023
a237e0a
fix(graph): fix graph chart can't be hidden by legend due to edgeLabe…
plainheart May 14, 2023
dfd95aa
chore: enable eslint cache.
plainheart May 14, 2023
daa7479
Merge pull request #18624 from apache/fix/graph/edgeLabel-NPE
plainheart May 15, 2023
38d0265
Merge pull request #18625 from apache/test/pie-selectedOffset
plainheart May 15, 2023
a555684
Merge pull request #18469 from apache/fix-18453
Ovilia May 23, 2023
9291b82
chore(deps): bump socket.io-parser from 3.4.2 to 3.4.3
dependabot[bot] May 23, 2023
e20d372
Merge pull request #18660 from apache/dependabot/npm_and_yarn/socket.…
plainheart May 24, 2023
0e7eac7
feat(ssr): improve code
Ovilia May 31, 2023
060d5f9
test(deps): move some dependencies that only are required by VRT to d…
plainheart Jun 7, 2023
8c4b8f4
fix(husky): fix husky hooks not install brought by the update in 73e5…
plainheart Jun 7, 2023
306af10
test(deps): move `slugify` to test folder
plainheart Jun 7, 2023
54d8243
fix(label): revert fdda0254e2a1594f71a44a2a0c30def700e58acb (#18222)
plainheart Jun 8, 2023
9ea570c
fix(sankey): fix `value` is undefined in label/edgeLabel formatter.
plainheart Jun 8, 2023
9ee9b91
fix(sankey): prevent `edgeLabel` formatter from inheriting `label.for…
plainheart Jun 8, 2023
7dce2b6
test(pie): tweak `pie-label` test case
plainheart Jun 8, 2023
5ae2c84
feat(test): add tips for installing dependencies before running visua…
plainheart Jun 8, 2023
b7002c6
feat(test): add scripts into VRT tool package.json
plainheart Jun 8, 2023
b2ff198
feat(ssr): call registerSSRDataGetter instead of metaData
Ovilia Jun 13, 2023
0749a65
Merge pull request #18725 from apache/move-test-dep
Ovilia Jun 13, 2023
f36dc45
Merge pull request #18733 from apache/fix/sankey-label-formatter
Ovilia Jun 13, 2023
8ef4d3b
fix(api): only deprecate disConnect but not disconnect
Justineo Jun 14, 2023
f27b086
Merge pull request #18758 from Justineo/fix-disconnect
plainheart Jun 14, 2023
bcb695c
chore: add PR preview workflow
plainheart Jun 26, 2023
ac41c53
chore: change the query param `pr` of the `pr-preview` action to `ver…
plainheart Jun 26, 2023
a632970
chore(ssr): update building ssr client
Ovilia Jun 13, 2023
e7ad886
fix(sunburst): normalize label rotation when decompress from matrix
linghaoSu Jun 26, 2023
6bca132
chore(ssr): update building of ssr client
Ovilia Jun 27, 2023
c8ba77c
chore: merge
Ovilia Jun 27, 2023
01df82a
fix(ssr): remove unnecessary code
Ovilia Jun 27, 2023
cc71ba0
chore: update pre commit permission
Ovilia Jun 27, 2023
b0c8338
Merge pull request #18813 from apache/husky
plainheart Jun 27, 2023
0ddf9f7
Merge pull request #18808 from linghaoSu/fix/sunburst-rotate-label
Ovilia Jun 27, 2023
6876707
feat(pie): add angleRange for control pie range
linghaoSu Jun 28, 2023
48de47e
Merge pull request #18803 from apache/workflow/pr-preview
Ovilia Jun 29, 2023
3f083f1
chore(workflow): fix wrong env variable
plainheart Jun 29, 2023
78f56df
Merge pull request #18828 from apache/fix/workflow-env-var
Ovilia Jun 29, 2023
dda4970
Merge branch 'master' of https://github.com/apache/echarts into feat/…
plainheart Jun 29, 2023
497c756
chore(workflow): refactor pr review workflow
plainheart Jun 29, 2023
82153b6
Merge pull request #18829 from apache/workflow/pr-preview
Ovilia Jun 29, 2023
11e4386
Merge branch 'master' of https://github.com/apache/echarts into feat/…
plainheart Jun 29, 2023
56138ee
feat(pie): add endAngle insteadof angleRange
linghaoSu Jun 29, 2023
a373c6c
fix(sankey): fix other state color is 'target/source/gradient'
linghaoSu Jul 1, 2023
f22ee7e
fix(sankey): rm comment code & import type explicity
linghaoSu Jul 1, 2023
7866509
Merge pull request #18834 from linghaoSu/fix/sankey-emphasis
plainheart Jul 1, 2023
65d7442
fix(pie): fix endAngle logical more compact
linghaoSu Jul 3, 2023
9fa6220
Merge pull request #18836 from apache/master
plainheart Jul 3, 2023
9f9e2d3
fix(endLabel): endLabel fail with null data #18839
Ovilia Jul 4, 2023
91d1e03
test(endLabel): add test case
Ovilia Jul 4, 2023
b79777e
Merge pull request #18820 from linghaoSu/feat/pie-angleRange
Ovilia Jul 4, 2023
1d10ba8
fix(endLabel): remove check of inner
Ovilia Jul 5, 2023
a92b0df
Merge pull request #18841 from apache/fix-endLabel
Ovilia Jul 5, 2023
a8ceb5b
fix(endLabel): endLabel fail with null data #18839
Ovilia Jul 4, 2023
ca3718a
test(endLabel): add test case
Ovilia Jul 4, 2023
dd53fc9
fix(endLabel): remove check of inner
Ovilia Jul 5, 2023
f4f532d
Merge pull request #18845 from apache/release-dev
plainheart Jul 5, 2023
fd58e52
Update echarts.ts
captainhaddock18 Jul 7, 2023
173fac6
Merge pull request #18862 from captainhaddock18/master
plainheart Jul 7, 2023
429123d
fix(scatter): fix edge scatter may be clipped unexpectedly due to tin…
plainheart Jul 9, 2023
c525cbb
test: add two new test cases for scatter clip on Cartesian 2D coordin…
plainheart Jul 9, 2023
d674ebb
test: fix actions of the `clip.html` test case can't work as expected
plainheart Jul 9, 2023
65717db
fix(scatter): change the default tolerance to `0.1` to cover more sce…
plainheart Jul 9, 2023
111de66
Merge pull request #18867 from apache/fix/scatter-clip
plainheart Jul 10, 2023
aaa8cf9
chore: release v5.4.3
jiawulin001 Jul 13, 2023
18b361a
Merge pull request #18886 from jiawulin001/release-dev
Ovilia Jul 13, 2023
989c0b8
remove duplicate extends at GraphNodeItemOption
nenoNaninu Jul 18, 2023
42cb0cc
Merge pull request #18904 from apache/release
plainheart Jul 18, 2023
ab14d46
Merge pull request #18901 from nenoNaninu/rm_duplicate_extends
plainheart Jul 18, 2023
76e5d4a
chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4
dependabot[bot] Jul 19, 2023
3f9c0b9
Merge pull request #18908 from apache/dependabot/npm_and_yarn/word-wr…
plainheart Jul 19, 2023
5d1aacd
fix(tooltip): fix opacity not work in tooltip marker
linghaoSu Jul 23, 2023
3bcb901
Fix return type of graphic.clipRectByRect.
benlongo Aug 2, 2023
586ca04
Merge pull request #18950 from benlongo/patch-1
plainheart Aug 2, 2023
7d02d5c
fix(line): fix line may cross when animation is enabled. (brought by …
plainheart Aug 4, 2023
8734ed1
fix(sunburst): fix align error caused by float precision
linghaoSu Aug 5, 2023
db20365
fix(source): fix multi typed array detect error
linghaoSu Aug 23, 2023
bb1e18c
Merge pull request #19035 from linghaoSu/fix/typed-array-list
Ovilia Aug 29, 2023
5b448f6
Merge pull request #18962 from linghaoSu/fix/sunburst-label-align
Ovilia Aug 30, 2023
428e2ad
feat(tooltip): add `appendTo` option to allow customizing tooltip con…
viking7982 Sep 2, 2023
4ce776c
feat(pie): add padAngle for pie
linghaoSu Sep 3, 2023
0885981
feat: add endAngle option
yassilah Sep 9, 2023
3a47529
feat: add endAngle option
yassilah Sep 9, 2023
fbc8d79
chore: remove dist changes
yassilah Sep 9, 2023
0862d1c
test: add visual test
yassilah Sep 9, 2023
8a2f216
use zrUtil and fix radiusAxisView
yassilah Sep 9, 2023
589f66d
cleanup
yassilah Sep 10, 2023
a06dd62
fix(visualMap): fix continuous visualMap mouseover event not register…
linghaoSu Sep 11, 2023
de074fb
feat(type): export `EChartsInitOpts` and more types for `echarts/core…
Sep 12, 2023
fbee94d
fix(i18n): enhance default language fallback (#19107)
ultravires Sep 12, 2023
33b437d
Add nullables to OptionDataValue
avin-kavish Sep 13, 2023
b37d67c
Merge pull request #19076 from linghaoSu/feat/pie_pad-angle
Ovilia Sep 15, 2023
a57202d
fix(clip): add extra clip to prevent unexpected clip on certain scena…
RexSkz Sep 15, 2023
fa231d3
Merge pull request #19056 from RexSkz/fix-19051
Ovilia Sep 19, 2023
06b1d3c
feat(tooltip): add dataIndex to valueFormatter callback. close #18997
ChepteaCatalin Sep 17, 2023
93d542c
Merge pull request #18921 from linghaoSu/fix/tooltip-color
Ovilia Sep 22, 2023
ba44156
Merge branch 'apache:master' into fix-18997
ChepteaCatalin Sep 22, 2023
a51f449
Merge pull request #19111 from avin-kavish/patch-1
Ovilia Sep 26, 2023
80b251f
Merge pull request #19123 from ChepteaCatalin/fix-18997
Ovilia Sep 26, 2023
691d9ee
fix: visual regression with circle
yassilah Sep 26, 2023
d08664f
Merge pull request #19099 from yassilah/feat-polar-endAngle
Ovilia Sep 27, 2023
0508353
fix(toolbox): fix toolbox text can't apply the specified or inherited…
plainheart Oct 3, 2023
4a3d090
Merge pull request #19170 from apache/fix/toolbox/font
Ovilia Oct 4, 2023
38ec1b5
fix #19050
shiersansi Oct 6, 2023
ea28e44
Merge pull request #19174 from shiersansi/fix-#19050
Ovilia Oct 8, 2023
d9e67dd
fix(sunburst): label rotation flipping
Ovilia Oct 8, 2023
f38c2a6
feat(pictorialBar): support clip for pictorialBar series
Ovilia Oct 12, 2023
8eb29bd
chore(deps-dev): bump @babel/traverse from 7.11.5 to 7.23.2
dependabot[bot] Oct 16, 2023
522c75d
Merge pull request #19213 from apache/dependabot/npm_and_yarn/babel/t…
Ovilia Oct 17, 2023
677adea
fix(core): fix potential NPE when reading default init options from g…
sunpm Oct 18, 2023
31d58b2
feat(i18n): add Arabic(AR) translation (#19214)
OthmanAliModaes Oct 18, 2023
1ab5597
feat(label): support align for min/max labels
Ovilia Oct 20, 2023
3ea1970
feat(label): fix lint problems
Ovilia Oct 20, 2023
6ce4dbc
fix(labelLine):emphasis.labelLine not work in pie chart (#19180)
shiersansi Oct 20, 2023
babe688
test(labelLine): add test for #19180
linghaoSu Oct 23, 2023
6b581e7
fix(aria): series type name for custom series #18054
Ovilia Oct 24, 2023
625ec1f
feat(aria): support aria i18n for some languages
Ovilia Oct 24, 2023
6061e1d
Merge pull request #19239 from apache/feat-aria-i18n
plainheart Oct 25, 2023
367610f
feat(i18n): add Dutch(NL) translation (#19252)
tijmenamsing Oct 27, 2023
818853e
Merge pull request #19176 from apache/fix-sunburst-label
plainheart Nov 1, 2023
fd9e62d
fix(tooltip): fix potential NPE when the parent node of the tooltip e…
plainheart Nov 6, 2023
77a3723
feat(sampler): add min-max sampler function
snukhulov Nov 6, 2023
0edce2a
fix(pictorialBar): ignore clipping label
Ovilia Nov 8, 2023
71799e9
Merge branch 'master' into feat-pictorialBar-clip
Ovilia Nov 8, 2023
7dd9b37
chore: merge
Ovilia Nov 16, 2023
badfd0f
chore: use zrender nightly build
Ovilia Nov 16, 2023
b07ce79
Merge pull request #18381 from apache/ssr
Ovilia Nov 16, 2023
4a63340
feat(sampler): add min-max sampler function
snukhulov Nov 25, 2023
c5e0910
Merge pull request #19279 from snukhulov/feat-add-minmax-sampler
Ovilia Nov 27, 2023
80525ed
Merge pull request #18960 from apache/fix/line-animation
Ovilia Nov 30, 2023
7731729
Merge pull request #19197 from apache/feat-pictorialBar-clip
linghaoSu Nov 30, 2023
a59feb4
[test] Add test case for https://github.com/apache/echarts/issues/19093
100pah Dec 4, 2023
5b0c096
Merge pull request #19357 from apache/master-tmp
plainheart Dec 5, 2023
fde32af
fix: fix barMinWidth and barMaxWidth types.
zhaxnb Dec 20, 2023
34f81b6
Merge pull request #19424 from zhaxnb/master
Ovilia Dec 20, 2023
b69e163
Merge pull request #19228 from apache/feat-axis-align-lastLabel
Ovilia Dec 26, 2023
d047d71
fix: Fix typo s/Usefull/Useful/
hugo-syn Dec 28, 2023
69cab1f
Merge pull request #19446 from hugo-syn/master
plainheart Dec 29, 2023
f301050
fix: Fix typo s/buidling/building/
hugo-syn Dec 29, 2023
d373387
Merge pull request #19449 from hugo-syn/master
plainheart Dec 31, 2023
c422a5d
chore(workflow): add a scheduled workflow to update the NOTICE year a…
plainheart Dec 31, 2023
642f377
style: remove redundant empty lines
plainheart Dec 31, 2023
3238144
Merge pull request #19452 from apache/workflow/update-notice-year
pissang Dec 31, 2023
60cbc9f
chore(workflow): fix timezone error when getting new year by `new Date`
plainheart Dec 31, 2023
57be343
chore: update NOTICE year to 2024
github-actions[bot] Jan 1, 2024
247889a
Merge pull request #19455 from apache/bot/update-notice-year/2024
plainheart Jan 1, 2024
f1d9eb5
Merge pull request #19454 from apache/fix/workflow/update-notice-year
plainheart Jan 1, 2024
7a26ce5
fix(ssr): remove redundant SVG attributes with `undefined` value.
plainheart Jan 2, 2024
9d61cbc
Merge pull request #19461 from apache/fix-ssr-data-undefined
Ovilia Jan 3, 2024
0df7c0d
chore: fix some typos
striezel Jan 6, 2024
b29904f
chore(workflow): update actions/checkout in workflows to v4
striezel Jan 6, 2024
9711002
Merge pull request #19473 from striezel-stash/fix-typos
plainheart Jan 7, 2024
0a0e411
Merge pull request #19474 from striezel-stash/actions-checkout-v4
plainheart Jan 7, 2024
67ac77c
chore(workflow): update actions/setup-node in workflows to v4
striezel Jan 8, 2024
17b53e1
Merge pull request #19476 from striezel-stash/actions-setup-node-v4
plainheart Jan 8, 2024
ca52a24
Fix ValueAxisBaseOption document
taks Jan 12, 2024
58b9417
Merge pull request #19499 from taks/fix-document
plainheart Jan 12, 2024
64fdec6
chore: ignore ssr src when release npm
Ovilia Jan 15, 2024
94dd855
Merge pull request #19512 from apache/feat/ssr-build
Ovilia Jan 15, 2024
23545a6
feat: change to default ESM package. For developer testing and node u…
100pah Jan 15, 2024
690ebe6
fix(graph): fix force layout iteration timer doesn't stop after dispo…
plainheart Jan 15, 2024
3a056bd
fix(markArea): fix markArea position when axis is with alignWithLabel
Ovilia Jan 16, 2024
6cae00c
Merge pull request #19514 from apache/fix/graph-dispose
Ovilia Jan 16, 2024
53bb9ff
Merge pull request #19516 from apache/fix/mark-area
plainheart Jan 16, 2024
2438562
feat(animation): support multi-level drill-down for universal transit…
plainheart Jan 18, 2024
a2efa57
refactor(util): import `liftColor` function from zrender (ecomfe/zren…
plainheart Jan 19, 2024
abe29f0
[fix] tweak ssr ts type, impl, exports and eslint
100pah Jan 22, 2024
80172d6
Merge branch 'master' into module_default_esm
100pah Jan 22, 2024
9c3fc0e
Merge pull request #19526 from apache/import-liftColor-from-zrender
Ovilia Jan 22, 2024
6b8fae8
Merge pull request #19513 from apache/module_default_esm
Ovilia Jan 22, 2024
f996884
Merge pull request #19532 from apache/master
Ovilia Jan 23, 2024
d403486
fix: (1) fix that some old version bundler (like rollup) do not recog…
100pah Jan 24, 2024
61af513
Merge pull request #19543 from apache/module_default_esm_fix
Ovilia Jan 25, 2024
e14cc9a
fix(ssr): hovering legend items should not trigger tooltip
Ovilia Jan 25, 2024
1b1284f
Revert "fix(tooltip): fix opacity not work in tooltip marker"
linghaoSu Jan 29, 2024
2a43d11
Merge pull request #19558 from apache/revert-18921-fix/tooltip-color
Ovilia Jan 29, 2024
0392fb3
fix(ssr): call registerSSRDataGetter only with ssr
Ovilia Jan 29, 2024
2deb0fd
Merge pull request #19549 from apache/release-dev
Ovilia Jan 30, 2024
3c6d9bb
chore: release 5.5.0
Ovilia Jan 30, 2024
52735fa
Merge pull request #19564 from apache/release-dev
Ovilia Jan 30, 2024
dadc3ce
chore: add source release debug file
Ovilia Jan 30, 2024
39a690e
chore: log jest version
Ovilia Jan 30, 2024
5cd6322
Merge pull request #19567 from apache/chore-source-release
plainheart Jan 30, 2024
fde9fbd
fix(test): rename `jest.config.js` to `jest.config.cjs` to fix jest c…
plainheart Jan 30, 2024
0e30eac
Revert "chore: add source release debug file"
plainheart Jan 30, 2024
4d3bbae
Merge pull request #19568 from apache/fix-jest
Ovilia Jan 31, 2024
b7548af
chore: add a key
Ovilia Jan 31, 2024
031a908
Merge pull request #19569 from apache/revert-19567-chore-source-release
Ovilia Jan 31, 2024
3fbfd2b
Merge pull request #19577 from apache/release-dev
plainheart Jan 31, 2024
6cefe27
fix: (1) Mistake in package.json "exports"."require" (2) Add entry fo…
100pah Feb 4, 2024
e3fa16c
Merge pull request #19593 from apache/module_default_esm_fix2
Ovilia Feb 4, 2024
b0b4639
chore: relase 5.5.0-rc.2
Ovilia Feb 4, 2024
b046d78
chore: rebuild and relase 5.5.0-rc.2
Ovilia Feb 4, 2024
0f4967b
Merge pull request #19594 from apache/release-dev
Ovilia Feb 4, 2024
385a817
fix(toolbox): use `typeof` keyword rather than `isFunction` util to d…
plainheart Feb 16, 2024
706b74b
Merge pull request #19620 from apache/fix/toolbox/saveAsImage
Ovilia Feb 20, 2024
b9f7809
Merge pull request #19628 from apache/release
plainheart Feb 21, 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
2 changes: 1 addition & 1 deletion .eslintrc-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rules:
- "error"
prefer-const: 1
no-constant-condition: 0
comma-dangle: 2
comma-dangle: 0
no-debugger: 2
no-dupe-keys: 2
no-empty-character-class: 2
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/.scripts/update-notice-year.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* @typedef {import('@octokit/rest').Octokit} Octokit
* @typedef {import('@actions/github')['context']} Context
*/

module.exports = async function updateNoticeYear(
/** @type {{ octokit: Octokit, context: Context }} */
{ octokit, context }
) {
const now = new Date()
// Change to UTC+8
now.setHours(now.getHours() + 8)
const newYear = now.getFullYear()
console.log('Prepare to update notice year to', newYear)

const noticeContent = `Apache ECharts
Copyright 2017-${newYear} The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).`

const repoCtx = context.repo

const repoInfo = (await octokit.rest.repos.get(repoCtx)).data
const defaultBranchName = repoInfo.default_branch
const remoteNoticeFile = (await octokit.rest.repos.getContent({
...repoCtx,
path: 'NOTICE',
ref: defaultBranchName
})).data
const remoteNoticeContent = base64ToUtf8(remoteNoticeFile.content)
if (remoteNoticeContent === noticeContent) {
console.log('NOTICE year is already updated.')
return
}

console.log('Ready to update the NOTICE file:\n' + noticeContent)

const defaultBranch = (await octokit.rest.repos.getBranch({
...repoCtx,
branch: defaultBranchName
})).data

const newBranchName = `bot/update-notice-year/${newYear}`
await octokit.rest.git.createRef({
...repoCtx,
ref: `refs/heads/${newBranchName}`,
sha: defaultBranch.commit.sha
})
console.log('Created a new branch:', newBranchName)

await octokit.rest.repos.createOrUpdateFileContents({
...repoCtx,
path: 'NOTICE',
message: `chore: update NOTICE year to ${newYear}`,
content: utf8ToBase64(noticeContent),
sha: remoteNoticeFile.sha,
branch: newBranchName
})

console.log('Updated the NOTICE file on the new branch')

const pr = (await octokit.rest.pulls.create({
...repoCtx,
head: newBranchName,
base: defaultBranchName,
maintainer_can_modify: true,
title: `chore: update NOTICE year to ${newYear}`,
body: `## Brief Information

This pull request is in the type of:

- [ ] bug fixing
- [ ] new feature
- [x] others

### What does this PR do?

Update notice year to ${newYear}. 💖

Happy new year! 祝大家新年快乐!🎇`
})).data

console.log(`Opened PR #${pr.number} for updating the NOTICE file`)
}

function utf8ToBase64(data) {
return Buffer.from(data, 'utf-8').toString('base64')
}

function base64ToUtf8(data) {
return Buffer.from(data, 'base64').toString('utf-8')
}
52 changes: 45 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ name: Node CI

on:
pull_request:
types: [opened, synchronize]
types: [opened, reopened, synchronize]

concurrency:
# Note that the `teardown-pr-preview` workflow needs the same group name
# to cancel the running `ci` workflows
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true

jobs:
lint:
Expand All @@ -19,12 +25,12 @@ jobs:
run: |
echo "FETCH_DEPTH=$(($PR_COMMIT_COUNT + 1))" >> $GITHUB_ENV

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -61,10 +67,10 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -81,11 +87,43 @@ jobs:
if: steps.cache-dep.outputs.cache-hit != 'true'
run: npm ci

- name: Unit Test
run: npm run test

- name: Build release
run: npm run release

- name: Test generated DTS
run: npm run test:dts

- name: Unit Test
run: npm run test
- name: Pack npm tarball
if: ${{ github.repository_owner == 'apache' }}
id: pack-tarball
run: |
export PR_PREVIEW_DIR='echarts-pr-preview'
mkdir -p $PR_PREVIEW_DIR
npm pack -pack-destination $PR_PREVIEW_DIR
echo "PR_PREVIEW_DIR=$PR_PREVIEW_DIR" >> $GITHUB_ENV

- name: Save PR metadata and dist files
if: ${{ steps.pack-tarball.outcome == 'success' }}
id: save-pr-data
env:
PR_NUMBER: ${{ github.event.number }}
PR_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_PREVIEW_DIR: ${{ env.PR_PREVIEW_DIR }}
run: |
cd $PR_PREVIEW_DIR
echo $PR_NUMBER > ./pr_number
echo $PR_COMMIT_SHA > ./pr_commit_sha
find . -type f -regex ".*\.tgz" -exec tar xvzf {} \;
rm -f *.tgz
echo -e "Dist files: \n$(ls -l)"

- uses: actions/upload-artifact@v3
if: ${{ steps.save-pr-data.outcome == 'success' }}
with:
name: pr_preview
path: ${{ env.PR_PREVIEW_DIR }}
retention-days: 1
if-no-files-found: error
4 changes: 2 additions & 2 deletions .github/workflows/nightly-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: next

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ matrix.node-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ matrix.node-version }}
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Deploy PR Preview

on:
workflow_run:
workflows: ['Node CI']
types: [completed]

jobs:
on-success:
if: ${{ github.repository_owner == 'apache' }}
runs-on: ubuntu-latest

steps:
- name: Determine if workflow build job is successful
id: check-build-success
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const jobsRes = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id
});
return jobsRes.data.jobs.some((job) => job.name.includes('build') && job.conclusion === 'success');

outputs:
SHOULD_DEPOLY: ${{ steps.check-build-success.outputs.result }}

deploy:
needs: [on-success]
if: ${{ needs.on-success.outputs.SHOULD_DEPOLY == 'true' }}
runs-on: ubuntu-latest

steps:
- name: Install action dependencies
run: |
mkdir .actions
cd .actions
git clone --depth=1 https://github.com/dawidd6/action-download-artifact.git
git clone --depth=1 https://github.com/actions-cool/maintain-one-comment.git

- name: Fetch PR dist files
uses: ./.actions/action-download-artifact
with:
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
name: pr_preview
if_no_artifact_found: fail

- name: Output PR metadata
id: pr-metadata
run: |
echo "NUMBER=$(cat pr_number)" >> $GITHUB_OUTPUT
echo "COMMIT_SHA=$(cat pr_commit_sha)" >> $GITHUB_OUTPUT
echo "COMMIT_SHA_SHORT=$(cat pr_commit_sha | cut -c 1-7)" >> $GITHUB_OUTPUT

- name: Deploy dist files
env:
PR_NUMBER: ${{ steps.pr-metadata.outputs.NUMBER }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
run: |
export SURGE_DOMAIN=https://echarts-pr-$PR_NUMBER.surge.sh
npx surge --project ./package --domain $SURGE_DOMAIN --token $SURGE_TOKEN

- name: Create comment for PR preview
uses: ./.actions/maintain-one-comment
env:
PR_NUMBER: ${{ steps.pr-metadata.outputs.NUMBER }}
COMMIT_SHA_SHORT: ${{ steps.pr-metadata.outputs.COMMIT_SHA_SHORT }}
with:
body: |
<!-- ECHARTS_PR_PREVIEW -->
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-${{ env.PR_NUMBER }}@${{ env.COMMIT_SHA_SHORT }}
body-include: '<!-- ECHARTS_PR_PREVIEW -->'
number: ${{ env.PR_NUMBER }}
11 changes: 6 additions & 5 deletions .github/workflows/source-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -59,10 +59,10 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -87,6 +87,7 @@ jobs:
index.d.ts
src/
extension-src/
ssr/client/src/
licenses/
theme/
build/
Expand All @@ -113,7 +114,7 @@ jobs:

steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/teardown-pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Teardown PR Preview

on:
pull_request_target:
types: [closed]

jobs:
teardown-pr-preview:
if: ${{ github.repository_owner == 'apache' && github.event.action == 'closed' && github.event.pull_request.merged != true }}
concurrency:
# to cancel running `ci` workflows in current PR
group: 'Node CI-${{ github.event.number }}'
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: Install action dependencies
run: git clone --depth=1 https://github.com/actions-cool/maintain-one-comment.git

- name: Delete PR preview comment
uses: ./maintain-one-comment
with:
body-include: '<!-- ECHARTS_PR_PREVIEW -->'
delete: true
number: ${{ github.event.number }}

- name: Teardown closed PR preview
continue-on-error: true
run: |
export SURGE_DOMAIN='https://echarts-pr-${{ github.event.number }}.surge.sh'
npx surge teardown $SURGE_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/update-notice-year.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update NOTICE year

on:
schedule:
# 1/1 00:00 UTC+8
- cron: '0 16 31 12 *'
workflow_dispatch:

jobs:
update-notice-year:
if: ${{ github.repository_owner == 'apache' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows/.scripts

- uses: actions/github-script@v7
with:
script: |
const updateNoticeYear = require('.github/workflows/.scripts/update-notice-year.js')
await updateNoticeYear({ octokit: github, context })
Loading
Loading