diff --git a/.lgtm.yml b/.lgtm.yml index b6fe4a8ba7..55762e6986 100644 --- a/.lgtm.yml +++ b/.lgtm.yml @@ -1,21 +1,17 @@ - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - +#Licensed to the Apache Software Foundation (ASF) under one +#or more contributor license agreements. See the NOTICE file +#distributed with this work for additional information +#regarding copyright ownership. The ASF licenses this file +#to you under the Apache License, Version 2.0 (the +#"License"); you may not use this file except in compliance +#with the License. You may obtain a copy of the License at +#http://www.apache.org/licenses/LICENSE-2.0 +#Unless required by applicable law or agreed to in writing, +#software distributed under the License is distributed on an +#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +#KIND, either express or implied. See the License for the +#specific language governing permissions and limitations +#under the License. path_classifiers: test: - test @@ -28,3 +24,4 @@ extraction: index: exclude: - dist +wefwef: wef diff --git a/som/.github/ISSUE_TEMPLATE/bug_report.yml b/som/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..86e9073e6e --- /dev/null +++ b/som/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,98 @@ +name: Bug Report +description: Report a bug to Apache ECharts +title: "[Bug] " +labels: + - bug +body: + - + type: markdown + attributes: + value: | + The issue list is reserved exclusively for bug reports and feature requests. + + For usage questions, please use the following resources: + + - Read the [docs](https://echarts.apache.org/option.html) + - Find in [examples](https://echarts.apache.org/examples/) + - Look for / ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/echarts) + + For non-technical support or general questions, you can email [dev@echarts.apache.org](mailto:dev@echarts.apache.org). And don't forget to subscribe to our [mailing list](https://echarts.apache.org/maillist.html) to get updated with the project. + + Also try to search for your issue - it may have already been answered or even fixed in the development branch. However, if you find that an old, closed issue still persists in the latest version, you should open a new issue using the form below instead of commenting on the old issue. + - + #- type: checkboxes + #attributes: + #label: Is there an existing issue for this? + #description: Please search to see if an issue already exists for the bug you encountered. + #options: + #- label: I have searched the existing issues + #required: true + type: input + attributes: + label: Version + description: | + Check if the issue is reproducible with the latest stable version of Apache ECharts. + placeholder: | + e.g. 5.2.2 + validations: + required: true + - + type: input + attributes: + label: Link to Minimal Reproduction + description: | + If the reproduction does not need a build setup, please provide a link to [Official Editor](https://echarts.apache.org/examples/editor.html), [JSFiddle](https://jsfiddle.net/plainheart/e46ozpqj/7/), [JSBin](https://jsbin.com/) or [CodePen](https://codepen.io/Ovilia/pen/dyYWXWM). If it requires a build setup, you can use [CodeSandbox](https://codesandbox.io/s/echarts-basic-example-template-mpfz1s) or provide a GitHub repo. + The reproduction should be **minimal** - i.e. it should contain only the bare minimum amount of code needed to show the bug. + Please do not just fill in a random link. The issue will be closed if no valid reproduction is provided. [Why?](https://antfu.me/posts/why-reproductions-are-required) + validations: + required: true + - + type: textarea + attributes: + label: Steps to Reproduce + description: | + What do we need to do after opening your repo in order to make the bug happen? Clear and concise reproduction instructions are important for us to be able to triage your issue in a timely manner. Note that you can use [Markdown](https://guides.github.com/features/mastering-markdown/) to format lists and code. + placeholder: | + 1. How do you create the chart. + 2. What's the chart option + 3. User interactions before the error happens. + validations: + required: true + - + type: textarea + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + validations: + required: true + - + type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + validations: + required: true + - + type: textarea + attributes: + label: Environment + description: | + e.g. + - **OS**: macOS Monterey + - **Browser**: Chrome 96.0.4664.55 + - **Framework** Vue@3 + value: | + - OS: + - Browser: + - Framework: + render: markdown + validations: + required: false + - + type: textarea + attributes: + label: Any additional comments? + description: | + e.g. some background/context of how you ran into this bug. + validations: + required: false diff --git a/som/.github/ISSUE_TEMPLATE/config.yml b/som/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..6e6cce2725 --- /dev/null +++ b/som/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +#contact_links: +#- name: Apache ECharts Doc +#url: https://echarts.apache.org/option.html +#about: Please search question here before opening a new issue \ No newline at end of file diff --git a/som/.github/ISSUE_TEMPLATE/feature_request.yml b/som/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000..7b512e6364 --- /dev/null +++ b/som/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,38 @@ +name: Feature Request +description: Request a new feature from Apache ECharts +title: "[Feature] " +labels: + - new-feature +body: + - + type: markdown + attributes: + value: | + The issue list is reserved exclusively for bug reports and feature requests. + + For usage questions, please use the following resources: + + - Read the [docs](https://echarts.apache.org/option.html) + - Find in [examples](https://echarts.apache.org/examples/) + - Look for / ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/echarts) + + For non-technical support or general questions, you can email [dev@echarts.apache.org](mailto:dev@echarts.apache.org). And don't forget to subscribe to our [mailing list](https://echarts.apache.org/maillist.html) to get updated with the project. + + Also try to search for your issue - it may have already been answered or even fixed in the development branch. However, if you find that an old, closed issue still persists in the latest version, you should open a new issue using the form below instead of commenting on the old issue. + - + type: textarea + attributes: + label: What problem does this feature solve? + description: | + Explain your use case, context, and rationale behind this feature request. More importantly, what is the end user experience you are trying to build that led to the need for this feature? + + An important design goal of ECharts is keeping the API surface small and straightforward. In general, we only consider adding new features that solve a problem that cannot be easily dealt with using existing APIs (i.e. not just an alternative way of doing things that can already be done). The problem should also be common enough to justify the addition. + validations: + required: true + - + type: textarea + attributes: + label: What does the proposed API look like? + description: Describe how you propose to solve the problem and provide code samples of how the API would work once implemented. Note that you can use [Markdown](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) to format your code blocks. + validations: + required: true diff --git a/som/.github/workflows/ci.yml b/som/.github/workflows/ci.yml new file mode 100644 index 0000000000..058d415b2c --- /dev/null +++ b/som/.github/workflows/ci.yml @@ -0,0 +1,128 @@ +name: Node CI +on: + pull_request: + 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: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: + - 18.x + steps: + - + name: Fetch commit count + env: + PR_COMMIT_COUNT: '${{ github.event.pull_request.commits }}' + run: | + echo "FETCH_DEPTH=$(($PR_COMMIT_COUNT + 1))" >> $GITHUB_ENV + - + uses: actions/checkout@v4 + with: + fetch-depth: '${{ env.FETCH_DEPTH }}' + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Cache node modules + id: cache-dep + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: node_modules + key: '${{ runner.os }}-lint-${{ env.cache-name }}-${{ hashFiles(''**/package-lock.json'') }}' + - + name: Install dependencies + if: steps.cache-dep.outputs.cache-hit != 'true' + run: npm ci + - + name: Collect changed files + run: | + mkdir ~/tmp/ + git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} --diff-filter=ACM --name-only --relative '*src/**/*.ts' > ~/tmp/changed_files + echo -e "Changed files: \n$(cat ~/tmp/changed_files)" + - + name: Lint + run: npx eslint $(cat ~/tmp/changed_files) + - + name: Check types + run: npm run checktype + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Cache node modules + id: cache-dep + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: node_modules + key: '${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles(''**/package-lock.json'') }}' + - + name: Install dependencies + 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: 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@v4 + if: '${{ steps.save-pr-data.outcome == ''success'' }}' + with: + name: pr_preview + path: '${{ env.PR_PREVIEW_DIR }}' + retention-days: 1 + if-no-files-found: error diff --git a/som/.github/workflows/nightly-next.yml b/som/.github/workflows/nightly-next.yml new file mode 100644 index 0000000000..b77becc499 --- /dev/null +++ b/som/.github/workflows/nightly-next.yml @@ -0,0 +1,42 @@ +name: Publish Nightly Next +on: + schedule: + - + cron: '10 9 * * *' #After zrender nightly published + #committers can manually trigger with workflow_dispatch + workflow_dispatch: { } + repository_dispatch: + types: publish-nightly-next +jobs: + build: + runs-on: ubuntu-latest + if: '${{ github.repository_owner == ''apache'' }}' + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + with: + ref: next + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + registry-url: https://registry.npmjs.org/ + node-version: '${{ matrix.node-version }}' + - + name: Setup and publish nightly + run: | + node build/nightly/prepare.js --next + npm i zrender@npm:zrender-nightly@next + npm ci + npm ls zrender + node build/nightly/post.js + npm run release + npm run test + npm run test:dts + npm publish --tag next + env: + NODE_AUTH_TOKEN: '${{secrets.NPM_TOKEN}}' diff --git a/som/.github/workflows/nightly.yml b/som/.github/workflows/nightly.yml new file mode 100644 index 0000000000..bc411a3555 --- /dev/null +++ b/som/.github/workflows/nightly.yml @@ -0,0 +1,40 @@ +name: Publish Nightly +on: + schedule: + - + cron: '0 9 * * *' #After zrender nightly published + #committers can manually trigger with workflow_dispatch + workflow_dispatch: { } + repository_dispatch: + types: publish-nightly +jobs: + build: + runs-on: ubuntu-latest + if: '${{ github.repository_owner == ''apache'' }}' + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + registry-url: https://registry.npmjs.org/ + node-version: '${{ matrix.node-version }}' + - + name: Setup and publish nightly + run: | + node build/nightly/prepare.js + npm i zrender@npm:zrender-nightly + npm ci + npm ls zrender + node build/nightly/post.js + npm run release + npm run test + npm run test:dts + npm publish + env: + NODE_AUTH_TOKEN: '${{secrets.NPM_TOKEN}}' diff --git a/som/.github/workflows/pr-preview.yml b/som/.github/workflows/pr-preview.yml new file mode 100644 index 0000000000..0037b6d5ca --- /dev/null +++ b/som/.github/workflows/pr-preview.yml @@ -0,0 +1,75 @@ +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@v7 + 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: | + + 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: '' + number: '${{ env.PR_NUMBER }}' diff --git a/som/.github/workflows/source-release.yml b/som/.github/workflows/source-release.yml new file mode 100644 index 0000000000..256e6afecb --- /dev/null +++ b/som/.github/workflows/source-release.yml @@ -0,0 +1,132 @@ +name: Source Release +on: + release: + types: + - prereleased +jobs: + materials: + runs-on: ubuntu-latest + if: '${{ github.repository_owner == ''apache'' }}' + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Prepare env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - + name: Cache node modules + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + #npm cache files are stored in `~/.npm` on Linux/macOS + path: '~/.npm' + key: '${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles(''**/package-lock.json'') }}' + - + name: Prepare release materials + run: | + npm i + node build/source-release/prepareReleaseMaterials.js \ + --rcversion ${{env.RELEASE_VERSION}} \ + --commit ${{github.sha}} \ + --repo ${{github.repository}} \ + --out tmp/materials + - + name: Archive materials + uses: actions/upload-artifact@v4 + with: + name: apache-echarts-${{env.RELEASE_VERSION}}-release-materials + path: | + tmp/materials/* + source: + runs-on: ubuntu-latest + needs: materials + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Prepare env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - + #Get RELEASE_NOTE.txt and pack it into zip. + name: Download materials + uses: actions/download-artifact@v4 + with: + name: apache-echarts-${{env.RELEASE_VERSION}}-release-materials + - + #TODO Check release version is RC + #Archive before run others to avoid packing unknown files. + name: Archive source release + uses: actions/upload-artifact@v4 + with: + name: apache-echarts-${{env.RELEASE_VERSION}}-src + path: | + index.d.ts + src/ + extension-src/ + ssr/client/src/ + licenses/ + theme/ + build/ + !build/source-release + package.json + package-lock.json + LICENSE + NOTICE + README.md + tsconfig.json + test/ut + test/types + test/check-build.html + RELEASE_NOTE.txt + validate-source: + runs-on: ubuntu-latest + needs: source + strategy: + matrix: + node-version: + - 18.x + steps: + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Prepare env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - + name: Download source release + uses: actions/download-artifact@v4 + with: + name: apache-echarts-${{env.RELEASE_VERSION}}-src + path: tmp/echarts + - + name: Build source release + run: | + npm ci + npm run release + npm run test + npm run test:dts + working-directory: tmp/echarts diff --git a/som/.github/workflows/stale.yml b/som/.github/workflows/stale.yml new file mode 100644 index 0000000000..a5942541f5 --- /dev/null +++ b/som/.github/workflows/stale.yml @@ -0,0 +1,30 @@ +name: Closing Stale Issues +permissions: + issues: write + pull-requests: write +on: + schedule: + - + cron: '0 21 * * *' +jobs: + stale: + runs-on: ubuntu-latest + if: '${{ github.repository_owner == ''apache'' }}' + steps: + - + name: Close Stale Issues + uses: actions/stale@v9 + with: + days-before-stale: 730 + days-before-close: 7 + stale-issue-label: stale + stale-pr-label: stale + stale-issue-message: 'This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.' + close-issue-message: 'This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!' + close-issue-reason: 'not_planned' + stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. We are sorry for this but 2 years is a long time and the code base has been changed a lot. Thanks for your contribution anyway.' + close-pr-message: 'This PR has been automatically closed because it has not had recent activity. Sorry for that and we are looking forward to your next contribution.' + exempt-issue-labels: 'FAQ,priority: high' + exempt-all-milestones: true + operations-per-run: 500 + ascending: true diff --git a/som/.github/workflows/teardown-pr-preview.yml b/som/.github/workflows/teardown-pr-preview.yml new file mode 100644 index 0000000000..c92c4ea3ad --- /dev/null +++ b/som/.github/workflows/teardown-pr-preview.yml @@ -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: '' + 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 }} diff --git a/som/.github/workflows/update-notice-year.yml b/som/.github/workflows/update-notice-year.yml new file mode 100644 index 0000000000..83388d8d62 --- /dev/null +++ b/som/.github/workflows/update-notice-year.yml @@ -0,0 +1,23 @@ +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 }) diff --git a/som/.lgtm.yml b/som/.lgtm.yml new file mode 100644 index 0000000000..55762e6986 --- /dev/null +++ b/som/.lgtm.yml @@ -0,0 +1,27 @@ +#Licensed to the Apache Software Foundation (ASF) under one +#or more contributor license agreements. See the NOTICE file +#distributed with this work for additional information +#regarding copyright ownership. The ASF licenses this file +#to you under the Apache License, Version 2.0 (the +#"License"); you may not use this file except in compliance +#with the License. You may obtain a copy of the License at +#http://www.apache.org/licenses/LICENSE-2.0 +#Unless required by applicable law or agreed to in writing, +#software distributed under the License is distributed on an +#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +#KIND, either express or implied. See the License for the +#specific language governing permissions and limitations +#under the License. +path_classifiers: + test: + - test + library: + - benchmark/dep + generated: + - dist +extraction: + javascript: + index: + exclude: + - dist +wefwef: wef diff --git a/uk/.github/ISSUE_TEMPLATE/bug_report.yml b/uk/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..86e9073e6e --- /dev/null +++ b/uk/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,98 @@ +name: Bug Report +description: Report a bug to Apache ECharts +title: "[Bug] " +labels: + - bug +body: + - + type: markdown + attributes: + value: | + The issue list is reserved exclusively for bug reports and feature requests. + + For usage questions, please use the following resources: + + - Read the [docs](https://echarts.apache.org/option.html) + - Find in [examples](https://echarts.apache.org/examples/) + - Look for / ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/echarts) + + For non-technical support or general questions, you can email [dev@echarts.apache.org](mailto:dev@echarts.apache.org). And don't forget to subscribe to our [mailing list](https://echarts.apache.org/maillist.html) to get updated with the project. + + Also try to search for your issue - it may have already been answered or even fixed in the development branch. However, if you find that an old, closed issue still persists in the latest version, you should open a new issue using the form below instead of commenting on the old issue. + - + #- type: checkboxes + #attributes: + #label: Is there an existing issue for this? + #description: Please search to see if an issue already exists for the bug you encountered. + #options: + #- label: I have searched the existing issues + #required: true + type: input + attributes: + label: Version + description: | + Check if the issue is reproducible with the latest stable version of Apache ECharts. + placeholder: | + e.g. 5.2.2 + validations: + required: true + - + type: input + attributes: + label: Link to Minimal Reproduction + description: | + If the reproduction does not need a build setup, please provide a link to [Official Editor](https://echarts.apache.org/examples/editor.html), [JSFiddle](https://jsfiddle.net/plainheart/e46ozpqj/7/), [JSBin](https://jsbin.com/) or [CodePen](https://codepen.io/Ovilia/pen/dyYWXWM). If it requires a build setup, you can use [CodeSandbox](https://codesandbox.io/s/echarts-basic-example-template-mpfz1s) or provide a GitHub repo. + The reproduction should be **minimal** - i.e. it should contain only the bare minimum amount of code needed to show the bug. + Please do not just fill in a random link. The issue will be closed if no valid reproduction is provided. [Why?](https://antfu.me/posts/why-reproductions-are-required) + validations: + required: true + - + type: textarea + attributes: + label: Steps to Reproduce + description: | + What do we need to do after opening your repo in order to make the bug happen? Clear and concise reproduction instructions are important for us to be able to triage your issue in a timely manner. Note that you can use [Markdown](https://guides.github.com/features/mastering-markdown/) to format lists and code. + placeholder: | + 1. How do you create the chart. + 2. What's the chart option + 3. User interactions before the error happens. + validations: + required: true + - + type: textarea + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + validations: + required: true + - + type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + validations: + required: true + - + type: textarea + attributes: + label: Environment + description: | + e.g. + - **OS**: macOS Monterey + - **Browser**: Chrome 96.0.4664.55 + - **Framework** Vue@3 + value: | + - OS: + - Browser: + - Framework: + render: markdown + validations: + required: false + - + type: textarea + attributes: + label: Any additional comments? + description: | + e.g. some background/context of how you ran into this bug. + validations: + required: false diff --git a/uk/.github/ISSUE_TEMPLATE/config.yml b/uk/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..6e6cce2725 --- /dev/null +++ b/uk/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +#contact_links: +#- name: Apache ECharts Doc +#url: https://echarts.apache.org/option.html +#about: Please search question here before opening a new issue \ No newline at end of file diff --git a/uk/.github/ISSUE_TEMPLATE/feature_request.yml b/uk/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000..7b512e6364 --- /dev/null +++ b/uk/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,38 @@ +name: Feature Request +description: Request a new feature from Apache ECharts +title: "[Feature] " +labels: + - new-feature +body: + - + type: markdown + attributes: + value: | + The issue list is reserved exclusively for bug reports and feature requests. + + For usage questions, please use the following resources: + + - Read the [docs](https://echarts.apache.org/option.html) + - Find in [examples](https://echarts.apache.org/examples/) + - Look for / ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/echarts) + + For non-technical support or general questions, you can email [dev@echarts.apache.org](mailto:dev@echarts.apache.org). And don't forget to subscribe to our [mailing list](https://echarts.apache.org/maillist.html) to get updated with the project. + + Also try to search for your issue - it may have already been answered or even fixed in the development branch. However, if you find that an old, closed issue still persists in the latest version, you should open a new issue using the form below instead of commenting on the old issue. + - + type: textarea + attributes: + label: What problem does this feature solve? + description: | + Explain your use case, context, and rationale behind this feature request. More importantly, what is the end user experience you are trying to build that led to the need for this feature? + + An important design goal of ECharts is keeping the API surface small and straightforward. In general, we only consider adding new features that solve a problem that cannot be easily dealt with using existing APIs (i.e. not just an alternative way of doing things that can already be done). The problem should also be common enough to justify the addition. + validations: + required: true + - + type: textarea + attributes: + label: What does the proposed API look like? + description: Describe how you propose to solve the problem and provide code samples of how the API would work once implemented. Note that you can use [Markdown](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) to format your code blocks. + validations: + required: true diff --git a/uk/.github/workflows/ci.yml b/uk/.github/workflows/ci.yml new file mode 100644 index 0000000000..058d415b2c --- /dev/null +++ b/uk/.github/workflows/ci.yml @@ -0,0 +1,128 @@ +name: Node CI +on: + pull_request: + 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: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: + - 18.x + steps: + - + name: Fetch commit count + env: + PR_COMMIT_COUNT: '${{ github.event.pull_request.commits }}' + run: | + echo "FETCH_DEPTH=$(($PR_COMMIT_COUNT + 1))" >> $GITHUB_ENV + - + uses: actions/checkout@v4 + with: + fetch-depth: '${{ env.FETCH_DEPTH }}' + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Cache node modules + id: cache-dep + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: node_modules + key: '${{ runner.os }}-lint-${{ env.cache-name }}-${{ hashFiles(''**/package-lock.json'') }}' + - + name: Install dependencies + if: steps.cache-dep.outputs.cache-hit != 'true' + run: npm ci + - + name: Collect changed files + run: | + mkdir ~/tmp/ + git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} --diff-filter=ACM --name-only --relative '*src/**/*.ts' > ~/tmp/changed_files + echo -e "Changed files: \n$(cat ~/tmp/changed_files)" + - + name: Lint + run: npx eslint $(cat ~/tmp/changed_files) + - + name: Check types + run: npm run checktype + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Cache node modules + id: cache-dep + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: node_modules + key: '${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles(''**/package-lock.json'') }}' + - + name: Install dependencies + 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: 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@v4 + if: '${{ steps.save-pr-data.outcome == ''success'' }}' + with: + name: pr_preview + path: '${{ env.PR_PREVIEW_DIR }}' + retention-days: 1 + if-no-files-found: error diff --git a/uk/.github/workflows/nightly-next.yml b/uk/.github/workflows/nightly-next.yml new file mode 100644 index 0000000000..b77becc499 --- /dev/null +++ b/uk/.github/workflows/nightly-next.yml @@ -0,0 +1,42 @@ +name: Publish Nightly Next +on: + schedule: + - + cron: '10 9 * * *' #After zrender nightly published + #committers can manually trigger with workflow_dispatch + workflow_dispatch: { } + repository_dispatch: + types: publish-nightly-next +jobs: + build: + runs-on: ubuntu-latest + if: '${{ github.repository_owner == ''apache'' }}' + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + with: + ref: next + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + registry-url: https://registry.npmjs.org/ + node-version: '${{ matrix.node-version }}' + - + name: Setup and publish nightly + run: | + node build/nightly/prepare.js --next + npm i zrender@npm:zrender-nightly@next + npm ci + npm ls zrender + node build/nightly/post.js + npm run release + npm run test + npm run test:dts + npm publish --tag next + env: + NODE_AUTH_TOKEN: '${{secrets.NPM_TOKEN}}' diff --git a/uk/.github/workflows/nightly.yml b/uk/.github/workflows/nightly.yml new file mode 100644 index 0000000000..bc411a3555 --- /dev/null +++ b/uk/.github/workflows/nightly.yml @@ -0,0 +1,40 @@ +name: Publish Nightly +on: + schedule: + - + cron: '0 9 * * *' #After zrender nightly published + #committers can manually trigger with workflow_dispatch + workflow_dispatch: { } + repository_dispatch: + types: publish-nightly +jobs: + build: + runs-on: ubuntu-latest + if: '${{ github.repository_owner == ''apache'' }}' + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + registry-url: https://registry.npmjs.org/ + node-version: '${{ matrix.node-version }}' + - + name: Setup and publish nightly + run: | + node build/nightly/prepare.js + npm i zrender@npm:zrender-nightly + npm ci + npm ls zrender + node build/nightly/post.js + npm run release + npm run test + npm run test:dts + npm publish + env: + NODE_AUTH_TOKEN: '${{secrets.NPM_TOKEN}}' diff --git a/uk/.github/workflows/pr-preview.yml b/uk/.github/workflows/pr-preview.yml new file mode 100644 index 0000000000..0037b6d5ca --- /dev/null +++ b/uk/.github/workflows/pr-preview.yml @@ -0,0 +1,75 @@ +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@v7 + 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: | + + 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: '' + number: '${{ env.PR_NUMBER }}' diff --git a/uk/.github/workflows/source-release.yml b/uk/.github/workflows/source-release.yml new file mode 100644 index 0000000000..256e6afecb --- /dev/null +++ b/uk/.github/workflows/source-release.yml @@ -0,0 +1,132 @@ +name: Source Release +on: + release: + types: + - prereleased +jobs: + materials: + runs-on: ubuntu-latest + if: '${{ github.repository_owner == ''apache'' }}' + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Prepare env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - + name: Cache node modules + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + #npm cache files are stored in `~/.npm` on Linux/macOS + path: '~/.npm' + key: '${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles(''**/package-lock.json'') }}' + - + name: Prepare release materials + run: | + npm i + node build/source-release/prepareReleaseMaterials.js \ + --rcversion ${{env.RELEASE_VERSION}} \ + --commit ${{github.sha}} \ + --repo ${{github.repository}} \ + --out tmp/materials + - + name: Archive materials + uses: actions/upload-artifact@v4 + with: + name: apache-echarts-${{env.RELEASE_VERSION}}-release-materials + path: | + tmp/materials/* + source: + runs-on: ubuntu-latest + needs: materials + strategy: + matrix: + node-version: + - 18.x + steps: + - + uses: actions/checkout@v4 + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Prepare env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - + #Get RELEASE_NOTE.txt and pack it into zip. + name: Download materials + uses: actions/download-artifact@v4 + with: + name: apache-echarts-${{env.RELEASE_VERSION}}-release-materials + - + #TODO Check release version is RC + #Archive before run others to avoid packing unknown files. + name: Archive source release + uses: actions/upload-artifact@v4 + with: + name: apache-echarts-${{env.RELEASE_VERSION}}-src + path: | + index.d.ts + src/ + extension-src/ + ssr/client/src/ + licenses/ + theme/ + build/ + !build/source-release + package.json + package-lock.json + LICENSE + NOTICE + README.md + tsconfig.json + test/ut + test/types + test/check-build.html + RELEASE_NOTE.txt + validate-source: + runs-on: ubuntu-latest + needs: source + strategy: + matrix: + node-version: + - 18.x + steps: + - + name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + - + name: Prepare env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - + name: Download source release + uses: actions/download-artifact@v4 + with: + name: apache-echarts-${{env.RELEASE_VERSION}}-src + path: tmp/echarts + - + name: Build source release + run: | + npm ci + npm run release + npm run test + npm run test:dts + working-directory: tmp/echarts diff --git a/uk/.github/workflows/stale.yml b/uk/.github/workflows/stale.yml new file mode 100644 index 0000000000..a5942541f5 --- /dev/null +++ b/uk/.github/workflows/stale.yml @@ -0,0 +1,30 @@ +name: Closing Stale Issues +permissions: + issues: write + pull-requests: write +on: + schedule: + - + cron: '0 21 * * *' +jobs: + stale: + runs-on: ubuntu-latest + if: '${{ github.repository_owner == ''apache'' }}' + steps: + - + name: Close Stale Issues + uses: actions/stale@v9 + with: + days-before-stale: 730 + days-before-close: 7 + stale-issue-label: stale + stale-pr-label: stale + stale-issue-message: 'This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.' + close-issue-message: 'This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!' + close-issue-reason: 'not_planned' + stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. We are sorry for this but 2 years is a long time and the code base has been changed a lot. Thanks for your contribution anyway.' + close-pr-message: 'This PR has been automatically closed because it has not had recent activity. Sorry for that and we are looking forward to your next contribution.' + exempt-issue-labels: 'FAQ,priority: high' + exempt-all-milestones: true + operations-per-run: 500 + ascending: true diff --git a/uk/.github/workflows/teardown-pr-preview.yml b/uk/.github/workflows/teardown-pr-preview.yml new file mode 100644 index 0000000000..c92c4ea3ad --- /dev/null +++ b/uk/.github/workflows/teardown-pr-preview.yml @@ -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: '' + 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 }} diff --git a/uk/.github/workflows/update-notice-year.yml b/uk/.github/workflows/update-notice-year.yml new file mode 100644 index 0000000000..83388d8d62 --- /dev/null +++ b/uk/.github/workflows/update-notice-year.yml @@ -0,0 +1,23 @@ +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 }) diff --git a/uk/.lgtm.yml b/uk/.lgtm.yml new file mode 100644 index 0000000000..55762e6986 --- /dev/null +++ b/uk/.lgtm.yml @@ -0,0 +1,27 @@ +#Licensed to the Apache Software Foundation (ASF) under one +#or more contributor license agreements. See the NOTICE file +#distributed with this work for additional information +#regarding copyright ownership. The ASF licenses this file +#to you under the Apache License, Version 2.0 (the +#"License"); you may not use this file except in compliance +#with the License. You may obtain a copy of the License at +#http://www.apache.org/licenses/LICENSE-2.0 +#Unless required by applicable law or agreed to in writing, +#software distributed under the License is distributed on an +#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +#KIND, either express or implied. See the License for the +#specific language governing permissions and limitations +#under the License. +path_classifiers: + test: + - test + library: + - benchmark/dep + generated: + - dist +extraction: + javascript: + index: + exclude: + - dist +wefwef: wef