From fe70313470c632e1d8e201f4d1762e795204217f Mon Sep 17 00:00:00 2001 From: Suhaha Date: Thu, 8 Jan 2026 17:22:36 +0800 Subject: [PATCH 1/3] chore: update Node.js version and add Gulp configuration files - Updated Node.js version requirement in package.json to >=20.18.0. - Added Gulp configuration files for multiple packages to streamline build and development tasks. - Removed unused 'esm' dependency from package.json files across several packages. --- ui/package.json | 2 +- ui/packages/clinic-client/{gulpfile.esm.js => gulpfile.js} | 4 ++-- ui/packages/clinic-client/package.json | 1 - .../tidb-dashboard-client/{gulpfile.esm.js => gulpfile.js} | 4 ++-- ui/packages/tidb-dashboard-client/package.json | 1 - .../{gulpfile.esm.js => gulpfile.js} | 4 ++-- ui/packages/tidb-dashboard-for-clinic-cloud/package.json | 1 - .../{gulpfile.esm.js => gulpfile.js} | 4 ++-- ui/packages/tidb-dashboard-for-clinic-op/package.json | 1 - .../tidb-dashboard-for-op/{gulpfile.esm.js => gulpfile.js} | 4 ++-- ui/packages/tidb-dashboard-for-op/package.json | 1 - .../tidb-dashboard-lib/{gulpfile.esm.js => gulpfile.js} | 4 ++-- ui/packages/tidb-dashboard-lib/package.json | 1 - 13 files changed, 13 insertions(+), 19 deletions(-) rename ui/packages/clinic-client/{gulpfile.esm.js => gulpfile.js} (87%) rename ui/packages/tidb-dashboard-client/{gulpfile.esm.js => gulpfile.js} (91%) rename ui/packages/tidb-dashboard-for-clinic-cloud/{gulpfile.esm.js => gulpfile.js} (89%) rename ui/packages/tidb-dashboard-for-clinic-op/{gulpfile.esm.js => gulpfile.js} (86%) rename ui/packages/tidb-dashboard-for-op/{gulpfile.esm.js => gulpfile.js} (91%) rename ui/packages/tidb-dashboard-lib/{gulpfile.esm.js => gulpfile.js} (90%) diff --git a/ui/package.json b/ui/package.json index 7cad4fe047..1b457eb1e7 100644 --- a/ui/package.json +++ b/ui/package.json @@ -4,7 +4,7 @@ "version": "1.0.0", "license": "MIT", "engines": { - "node": ">=18.16.0 <19.0.0" + "node": ">=20.18.0" }, "packageManager": "pnpm@8.6.12", "scripts": { diff --git a/ui/packages/clinic-client/gulpfile.esm.js b/ui/packages/clinic-client/gulpfile.js similarity index 87% rename from ui/packages/clinic-client/gulpfile.esm.js rename to ui/packages/clinic-client/gulpfile.js index 4de1bab887..bf2fb9ae0a 100644 --- a/ui/packages/clinic-client/gulpfile.esm.js +++ b/ui/packages/clinic-client/gulpfile.js @@ -1,5 +1,5 @@ -import { task, series } from 'gulp' -import shell from 'gulp-shell' +const { task, series } = require('gulp') +const shell = require('gulp-shell') /////////////////////////// diff --git a/ui/packages/clinic-client/package.json b/ui/packages/clinic-client/package.json index 9a4c0f6480..a4de19aaa1 100644 --- a/ui/packages/clinic-client/package.json +++ b/ui/packages/clinic-client/package.json @@ -13,7 +13,6 @@ "license": "ISC", "devDependencies": { "@openapitools/openapi-generator-cli": "^2.5.1", - "esm": "^3.2.25", "gulp": "^4.0.2", "gulp-shell": "^0.8.0", "typescript": "^4.7.3" diff --git a/ui/packages/tidb-dashboard-client/gulpfile.esm.js b/ui/packages/tidb-dashboard-client/gulpfile.js similarity index 91% rename from ui/packages/tidb-dashboard-client/gulpfile.esm.js rename to ui/packages/tidb-dashboard-client/gulpfile.js index e2a621d0c8..379a40e4af 100644 --- a/ui/packages/tidb-dashboard-client/gulpfile.esm.js +++ b/ui/packages/tidb-dashboard-client/gulpfile.js @@ -1,5 +1,5 @@ -import { task, watch, series, parallel } from 'gulp' -import shell from 'gulp-shell' +const { task, watch, series, parallel } = require('gulp') +const shell = require('gulp-shell') /////////////////////////// diff --git a/ui/packages/tidb-dashboard-client/package.json b/ui/packages/tidb-dashboard-client/package.json index 209e2ff2f8..3c628bde0d 100644 --- a/ui/packages/tidb-dashboard-client/package.json +++ b/ui/packages/tidb-dashboard-client/package.json @@ -13,7 +13,6 @@ "license": "ISC", "devDependencies": { "@openapitools/openapi-generator-cli": "^2.5.1", - "esm": "^3.2.25", "gulp": "^4.0.2", "gulp-shell": "^0.8.0", "typescript": "^4.7.3" diff --git a/ui/packages/tidb-dashboard-for-clinic-cloud/gulpfile.esm.js b/ui/packages/tidb-dashboard-for-clinic-cloud/gulpfile.js similarity index 89% rename from ui/packages/tidb-dashboard-for-clinic-cloud/gulpfile.esm.js rename to ui/packages/tidb-dashboard-for-clinic-cloud/gulpfile.js index 9c4f91b9ae..63ce455702 100644 --- a/ui/packages/tidb-dashboard-for-clinic-cloud/gulpfile.esm.js +++ b/ui/packages/tidb-dashboard-for-clinic-cloud/gulpfile.js @@ -1,5 +1,5 @@ -import { task, series, parallel } from 'gulp' -import shell from 'gulp-shell' +const { task, series, parallel } = require('gulp') +const shell = require('gulp-shell') task( 'speedscope:copy', diff --git a/ui/packages/tidb-dashboard-for-clinic-cloud/package.json b/ui/packages/tidb-dashboard-for-clinic-cloud/package.json index 033e0a8bfe..0f7254f194 100644 --- a/ui/packages/tidb-dashboard-for-clinic-cloud/package.json +++ b/ui/packages/tidb-dashboard-for-clinic-cloud/package.json @@ -72,7 +72,6 @@ "esbuild-plugin-yaml": "^0.0.1", "eslint-plugin-cypress": "^2.12.1", "eslint-watch": "^8.0.0", - "esm": "^3.2.25", "fs-extra": "^10.0.0", "gulp": "^4.0.2", "gulp-shell": "^0.8.0", diff --git a/ui/packages/tidb-dashboard-for-clinic-op/gulpfile.esm.js b/ui/packages/tidb-dashboard-for-clinic-op/gulpfile.js similarity index 86% rename from ui/packages/tidb-dashboard-for-clinic-op/gulpfile.esm.js rename to ui/packages/tidb-dashboard-for-clinic-op/gulpfile.js index 9873a6ba54..0b8e696696 100644 --- a/ui/packages/tidb-dashboard-for-clinic-op/gulpfile.esm.js +++ b/ui/packages/tidb-dashboard-for-clinic-op/gulpfile.js @@ -1,5 +1,5 @@ -import { task, series, parallel } from 'gulp' -import shell from 'gulp-shell' +const { task, series, parallel } = require('gulp') +const shell = require('gulp-shell') task('tsc:watch', shell.task('tsc --watch')) task('tsc:check', shell.task('tsc')) diff --git a/ui/packages/tidb-dashboard-for-clinic-op/package.json b/ui/packages/tidb-dashboard-for-clinic-op/package.json index e5bbaea149..ba54aee5f6 100644 --- a/ui/packages/tidb-dashboard-for-clinic-op/package.json +++ b/ui/packages/tidb-dashboard-for-clinic-op/package.json @@ -42,7 +42,6 @@ "esbuild-plugin-svgr": "^1.0.0", "esbuild-plugin-yaml": "^0.0.1", "eslint-watch": "^8.0.0", - "esm": "^3.2.25", "fs-extra": "^10.0.0", "glob": "^8.0.3", "gulp": "^4.0.2", diff --git a/ui/packages/tidb-dashboard-for-op/gulpfile.esm.js b/ui/packages/tidb-dashboard-for-op/gulpfile.js similarity index 91% rename from ui/packages/tidb-dashboard-for-op/gulpfile.esm.js rename to ui/packages/tidb-dashboard-for-op/gulpfile.js index 19395fd7ba..b28e93192a 100644 --- a/ui/packages/tidb-dashboard-for-op/gulpfile.esm.js +++ b/ui/packages/tidb-dashboard-for-op/gulpfile.js @@ -1,5 +1,5 @@ -import { task, series, parallel } from 'gulp' -import shell from 'gulp-shell' +const { task, series, parallel } = require('gulp') +const shell = require('gulp-shell') task('distro:gen', shell.task('../../../scripts/distro/write_strings.sh')) diff --git a/ui/packages/tidb-dashboard-for-op/package.json b/ui/packages/tidb-dashboard-for-op/package.json index 2d8a2d56de..bf42e9ad3d 100644 --- a/ui/packages/tidb-dashboard-for-op/package.json +++ b/ui/packages/tidb-dashboard-for-op/package.json @@ -65,7 +65,6 @@ "esbuild-plugin-yaml": "^0.0.1", "eslint-plugin-cypress": "^2.12.1", "eslint-watch": "^8.0.0", - "esm": "^3.2.25", "fs-extra": "^10.0.0", "gulp": "^4.0.2", "gulp-shell": "^0.8.0", diff --git a/ui/packages/tidb-dashboard-lib/gulpfile.esm.js b/ui/packages/tidb-dashboard-lib/gulpfile.js similarity index 90% rename from ui/packages/tidb-dashboard-lib/gulpfile.esm.js rename to ui/packages/tidb-dashboard-lib/gulpfile.js index 452382c0cf..69d57f15a9 100644 --- a/ui/packages/tidb-dashboard-lib/gulpfile.esm.js +++ b/ui/packages/tidb-dashboard-lib/gulpfile.js @@ -1,5 +1,5 @@ -import { task, parallel } from 'gulp' -import shell from 'gulp-shell' +const { task, parallel } = require('gulp') +const shell = require('gulp-shell') // below way doesn't work // task('tsc:dev', parallel(shell.task('tsc -w'), shell.task('tsc-alias -w'))) diff --git a/ui/packages/tidb-dashboard-lib/package.json b/ui/packages/tidb-dashboard-lib/package.json index 5f8c4a5724..79de795e34 100644 --- a/ui/packages/tidb-dashboard-lib/package.json +++ b/ui/packages/tidb-dashboard-lib/package.json @@ -81,7 +81,6 @@ "esbuild-plugin-svgr": "^1.0.0", "esbuild-plugin-yaml": "^0.0.1", "eslint-watch": "^8.0.0", - "esm": "^3.2.25", "fs-extra": "^10.0.0", "gulp": "^4.0.2", "gulp-shell": "^0.8.0", From 2bcab3ce0cc922430091e5b5155ce93218a4236b Mon Sep 17 00:00:00 2001 From: Suhaha Date: Thu, 8 Jan 2026 17:23:40 +0800 Subject: [PATCH 2/3] chore: update Node.js version across multiple files to 22 - Updated Node.js version requirement in package.json files to >=22.0.0. - Modified CI workflows to use Node.js 22 for setup. - Adjusted contributing documentation to reflect the new Node.js version requirement. --- .github/workflows/build.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/upload-e2e-snapshots.yaml | 2 +- CONTRIBUTING.md | 10 +++++----- ui/README.md | 2 +- ui/package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a52f5f6419..4964b8613c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -56,7 +56,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "18" + node-version: "22" cache: "pnpm" cache-dependency-path: "ui/pnpm-lock.yaml" - uses: actions/setup-go@v3 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 11bebe65a5..bf060359a7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,7 +21,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "18" + node-version: "22" cache: "pnpm" cache-dependency-path: "ui/pnpm-lock.yaml" - uses: actions/setup-go@v3 diff --git a/.github/workflows/upload-e2e-snapshots.yaml b/.github/workflows/upload-e2e-snapshots.yaml index 2d84085815..346783764a 100644 --- a/.github/workflows/upload-e2e-snapshots.yaml +++ b/.github/workflows/upload-e2e-snapshots.yaml @@ -40,7 +40,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "18" + node-version: "22" cache: "pnpm" cache-dependency-path: "ui/pnpm-lock.yaml" - uses: actions/setup-go@v3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4f076d64f1..59c836b3f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ The followings are required for developing TiDB Dashboard: - git - Version control - make - Build tool (run common workflows) - [Golang 1.21+](https://golang.org/) - To compile the server. -- [Node.js 18](https://nodejs.org/) - To compile the front-end. +- [Node.js 22](https://nodejs.org/) - To compile the front-end. - [PNPM 8](https://pnpm.io/) - To manage front-end dependencies. - [Java 8+](https://www.java.com/ES/download/) - To generate JavaScript API client by OpenAPI specification. @@ -58,7 +58,7 @@ Package frontend and backend into a single binary: ```bash # Build a binary into `bin/tidb-dashboard`. make package - + # Run. make run ``` @@ -114,7 +114,7 @@ Swagger UI is available at http://localhost:12333/dashboard/api/swagger after th If you want to develop docker image locally 🤔. 1. Ensure the Docker Buildx is installed on your local machine. - + > Docker Buildx is included in Docker Desktop for Windows, macOS, and Linux. > Docker Linux packages also include Docker Buildx when installed using the DEB or RPM packages. @@ -129,7 +129,7 @@ If you want to develop docker image locally 🤔. # Or, if you want to build cross-platform image and push it to your dev docker registry, run: REPOSITORY=your-tidb-dashboard-repository make docker-build-and-push-image - + # Or, if you want to build centos7 based image, run: DOCKERFILE=./dockerfiles/centos7.Dockerfile make docker-build-image-locally-arm64 @@ -140,7 +140,7 @@ If you want to develop docker image locally 🤔. 3. Run newly build image with docker-compose. > Please make sure that `tiup playground` is not running on the background. - + ```bash # On repository root directory, run: docker-compose -f ./dockerfiles/docker-compose.yml up diff --git a/ui/README.md b/ui/README.md index 7f8ab93fd8..9df99a69e8 100644 --- a/ui/README.md +++ b/ui/README.md @@ -6,7 +6,7 @@ ## Requirements -- Node >= 18.16.0 +- Node >= 22.0.0 - [use corepack](https://www.totaltypescript.com/how-to-use-corepack): `corepack enable && corepack enable npm` ## Run diff --git a/ui/package.json b/ui/package.json index 1b457eb1e7..44d93442c5 100644 --- a/ui/package.json +++ b/ui/package.json @@ -4,7 +4,7 @@ "version": "1.0.0", "license": "MIT", "engines": { - "node": ">=20.18.0" + "node": ">=22.0.0" }, "packageManager": "pnpm@8.6.12", "scripts": { From 1c8591f5110c6401aa641f21e984880f7e9ed010 Mon Sep 17 00:00:00 2001 From: Suhaha Date: Thu, 8 Jan 2026 20:15:51 +0800 Subject: [PATCH 3/3] chore: remove unused 'esm' dependency and update 'debug' version - Removed 'esm' dependency from pnpm-lock.yaml across multiple packages. - Updated 'debug' package version from 4.4.1 to 4.4.3 for improved functionality and security. --- ui/pnpm-lock.yaml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 0489632d6c..473ddf8b57 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -39,9 +39,6 @@ importers: '@openapitools/openapi-generator-cli': specifier: ^2.5.1 version: 2.5.1 - esm: - specifier: ^3.2.25 - version: 3.2.25 gulp: specifier: ^4.0.2 version: 4.0.2 @@ -61,9 +58,6 @@ importers: '@openapitools/openapi-generator-cli': specifier: ^2.5.1 version: 2.5.1 - esm: - specifier: ^3.2.25 - version: 3.2.25 gulp: specifier: ^4.0.2 version: 4.0.2 @@ -218,9 +212,6 @@ importers: eslint-watch: specifier: ^8.0.0 version: 8.0.0(eslint@8.20.0) - esm: - specifier: ^3.2.25 - version: 3.2.25 fs-extra: specifier: ^10.0.0 version: 10.1.0 @@ -297,9 +288,6 @@ importers: eslint-watch: specifier: ^8.0.0 version: 8.0.0(eslint@8.20.0) - esm: - specifier: ^3.2.25 - version: 3.2.25 fs-extra: specifier: ^10.0.0 version: 10.0.1 @@ -472,9 +460,6 @@ importers: eslint-watch: specifier: ^8.0.0 version: 8.0.0(eslint@8.20.0) - esm: - specifier: ^3.2.25 - version: 3.2.25 fs-extra: specifier: ^10.0.0 version: 10.1.0 @@ -704,9 +689,6 @@ importers: eslint-watch: specifier: ^8.0.0 version: 8.0.0(eslint@8.20.0) - esm: - specifier: ^3.2.25 - version: 3.2.25 fs-extra: specifier: ^10.0.0 version: 10.1.0 @@ -8786,11 +8768,6 @@ packages: - supports-color dev: true - /esm@3.2.25: - resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} - engines: {node: '>=6'} - dev: true - /espree@9.3.2: resolution: {integrity: sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -17284,6 +17261,7 @@ packages: /whatwg-encoding@1.0.5: resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==} + deprecated: Use @exodus/bytes instead for a more spec-conformant and faster implementation dependencies: iconv-lite: 0.4.24 dev: true