This is an automated email from the ASF dual-hosted git repository.
lidongdai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/seatunnel-website.git
The following commit(s) were added to refs/heads/main by this push:
new 78afb9cba850 [docs] remove algolia add search local plugin (#365)
78afb9cba850 is described below
commit 78afb9cba85064aaa0fcf52340130a03fc5fcb1e
Author: zhiwei liu <[email protected]>
AuthorDate: Mon Mar 17 14:27:38 2025 +0800
[docs] remove algolia add search local plugin (#365)
---
.github/workflows/deploy.yml | 2 +-
docusaurus.config.js | 41 +--
package-lock.json | 633 ++++++++++++++++++++++++++++-----
package.json | 11 +-
tools/{build-docs.ts => build-docs.js} | 43 ++-
tools/common.js | 107 ++++++
tools/common.ts | 73 ----
tools/{image-copy.ts => image-copy.js} | 37 +-
tools/{version.ts => version.js} | 22 +-
tsconfig.json | 7 +-
10 files changed, 752 insertions(+), 224 deletions(-)
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index a62ae904c326..c870213dbd40 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
- node-version: 16.19.0
+ node-version: 18.20.7
- name: install
run: |
npm set strict-ssl false
diff --git a/docusaurus.config.js b/docusaurus.config.js
index bffc3f427454..85aeb510e743 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -28,6 +28,24 @@ const config = {
},
},
},
+ themes: [
+ [
+ require.resolve("@easyops-cn/docusaurus-search-local"),
+ /** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions}
*/
+ ({
+ // config url is:
https://github.com/easyops-cn/docusaurus-search-local#theme-options
+ hashed: true,
+ indexDocs: true,
+ indexPages: true,
+ highlightSearchTermsOnTargetPage: false, // Highlight search terms on
target page.
+ explicitSearchResultPath: true,
+ searchBarPosition: "right",
+ searchBarShortcutHint: false, // Whether to show keyboard shortcut
hint in search bar. Disable it if you need to hide the hint while shortcut is
still enabled.
+ language: ["zh", "en"],
+ hideSearchBarWithNoSearchContext: true,
+ }),
+ ],
+ ],
headTags: [
{
tagName: 'script',
@@ -301,29 +319,6 @@ const config = {
theme: require("prism-react-renderer/themes/dracula"),
darkTheme: darkCodeTheme,
},
- // https://docusaurus.io/zh-CN/docs/search#connecting-algolia
- algolia: {
- // The application ID provided by Algolia
- appId: "S2J1A7LWND",
- // Public API key: it is safe to commit it
- apiKey: "a19997f611a73120d7dfb30af9db4d3a",
- indexName: "seatunnel-apache",
-
- // Optional: see doc section below
- contextualSearch: true,
- // Optional: Specify domains where the navigation should occur through
window.location instead on history.push. Useful when our Algolia config crawls
multiple documentation sites and we want to navigate with window.location.href
to them.
- externalUrlRegex: "seatunnel\\.apache\\.org",
- // Optional: Replace parts of the item URLs from Algolia. Useful when
using the same search index for multiple deployments using a different baseUrl.
You can use regexp or string in the `from` param. For example: localhost:3000
vs myCompany.com/docs
- replaceSearchResultPathname: {
- from: "/docs/", // or as RegExp: /\/docs\//
- to: "/",
- },
- // Optional: Algolia search parameters
- searchParameters: {},
- // Optional: path for search page that enabled by default (`false` to
disable it)
- searchPagePath: "search",
- //... other Algolia params
- },
},
plugins: [
"docusaurus-plugin-less",
diff --git a/package-lock.json b/package-lock.json
index 36c17c095a47..b04d29b0a33f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11,7 +11,6 @@
"@docusaurus/core": "^2.4.3",
"@docusaurus/plugin-content-docs": "^2.4.3",
"@docusaurus/preset-classic": "^2.4.3",
- "@docusaurus/theme-search-algolia": "^2.4.3",
"@mdx-js/react": "^1.6.22",
"@svgr/webpack": "^6.2.1",
"clsx": "^1.1.1",
@@ -23,6 +22,7 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.4.3",
+ "@easyops-cn/docusaurus-search-local": "^0.49.1",
"@tsconfig/docusaurus": "^1.0.4",
"@types/fs-extra": "^11.0.4",
"cross-env": "^7.0.3",
@@ -32,7 +32,6 @@
"less": "^4.1.2",
"less-loader": "^10.2.0",
"picocolors": "^1.0.1",
- "tsx": "^3.14.0",
"typescript": "^4.5.5"
}
},
@@ -2750,19 +2749,108 @@
"node": ">=12"
}
},
- "node_modules/@esbuild/darwin-arm64": {
- "version": "0.18.20",
- "cpu": [
- "arm64"
- ],
+ "node_modules/@easyops-cn/autocomplete.js": {
+ "version": "0.38.1",
+ "resolved":
"https://registry.npmmirror.com/@easyops-cn/autocomplete.js/-/autocomplete.js-0.38.1.tgz",
+ "integrity":
"sha512-drg76jS6syilOUmVNkyo1c7ZEBPcPuK+aJA7AksM5ZIIbV57DMHCywiCr+uHyv8BE5jUTU98j/H7gVrkHrWW3Q==",
"dev": true,
"license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
+ "dependencies": {
+ "cssesc": "^3.0.0",
+ "immediate": "^3.2.3"
+ }
+ },
+ "node_modules/@easyops-cn/docusaurus-search-local": {
+ "version": "0.49.1",
+ "resolved":
"https://registry.npmmirror.com/@easyops-cn/docusaurus-search-local/-/docusaurus-search-local-0.49.1.tgz",
+ "integrity":
"sha512-UXt4G/5lLwxmd2NmX5CL5BRtPAIG09UHIowu4Q8cvrzcBE3O0sWAAq/NmF0SMyP8EmxHWWOyPJi8F2cx/rjSVg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@docusaurus/plugin-content-docs": "^2 || ^3",
+ "@docusaurus/theme-translations": "^2 || ^3",
+ "@docusaurus/utils": "^2 || ^3",
+ "@docusaurus/utils-common": "^2 || ^3",
+ "@docusaurus/utils-validation": "^2 || ^3",
+ "@easyops-cn/autocomplete.js": "^0.38.1",
+ "@node-rs/jieba": "^1.6.0",
+ "cheerio": "^1.0.0",
+ "clsx": "^2.1.1",
+ "comlink": "^4.4.2",
+ "debug": "^4.2.0",
+ "fs-extra": "^10.0.0",
+ "klaw-sync": "^6.0.0",
+ "lunr": "^2.3.9",
+ "lunr-languages": "^1.4.0",
+ "mark.js": "^8.11.1",
+ "tslib": "^2.4.0"
+ },
"engines": {
"node": ">=12"
+ },
+ "peerDependencies": {
+ "@docusaurus/theme-common": "^2 || ^3",
+ "react": "^16.14.0 || ^17 || ^18 || ^19",
+ "react-dom": "^16.14.0 || 17 || ^18 || ^19"
+ }
+ },
+ "node_modules/@easyops-cn/docusaurus-search-local/node_modules/clsx": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmmirror.com/clsx/-/clsx-2.1.1.tgz",
+ "integrity":
"sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@easyops-cn/docusaurus-search-local/node_modules/fs-extra": {
+ "version": "10.1.0",
+ "resolved":
"https://registry.npmmirror.com/fs-extra/-/fs-extra-10.1.0.tgz",
+ "integrity":
"sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@emnapi/core": {
+ "version": "1.3.1",
+ "resolved":
"https://registry.npmmirror.com/@emnapi/core/-/core-1.3.1.tgz",
+ "integrity":
"sha512-pVGjBIt1Y6gg3EJN8jTcfpP/+uuRksIo055oE/OBkDNcjZqVbfkWCksG1Jp4yZnj3iKWyWX8fdG/j6UDYPbFog==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/wasi-threads": "1.0.1",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@emnapi/runtime": {
+ "version": "1.3.1",
+ "resolved":
"https://registry.npmmirror.com/@emnapi/runtime/-/runtime-1.3.1.tgz",
+ "integrity":
"sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@emnapi/wasi-threads": {
+ "version": "1.0.1",
+ "resolved":
"https://registry.npmmirror.com/@emnapi/wasi-threads/-/wasi-threads-1.0.1.tgz",
+ "integrity":
"sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
}
},
"node_modules/@hapi/hoek": {
@@ -3030,6 +3118,287 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/@napi-rs/wasm-runtime": {
+ "version": "0.2.7",
+ "resolved":
"https://registry.npmmirror.com/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.7.tgz",
+ "integrity":
"sha512-5yximcFK5FNompXfJFoWanu5l8v1hNGqNHh9du1xETp9HWk/B/PzvchX55WYOPaIeNglG8++68AAiauBAtbnzw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/core": "^1.3.1",
+ "@emnapi/runtime": "^1.3.1",
+ "@tybys/wasm-util": "^0.9.0"
+ }
+ },
+ "node_modules/@node-rs/jieba": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba/-/jieba-1.10.4.tgz",
+ "integrity":
"sha512-GvDgi8MnBiyWd6tksojej8anIx18244NmIOc1ovEw8WKNUejcccLfyu8vj66LWSuoZuKILVtNsOy4jvg3aoxIw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ },
+ "optionalDependencies": {
+ "@node-rs/jieba-android-arm-eabi": "1.10.4",
+ "@node-rs/jieba-android-arm64": "1.10.4",
+ "@node-rs/jieba-darwin-arm64": "1.10.4",
+ "@node-rs/jieba-darwin-x64": "1.10.4",
+ "@node-rs/jieba-freebsd-x64": "1.10.4",
+ "@node-rs/jieba-linux-arm-gnueabihf": "1.10.4",
+ "@node-rs/jieba-linux-arm64-gnu": "1.10.4",
+ "@node-rs/jieba-linux-arm64-musl": "1.10.4",
+ "@node-rs/jieba-linux-x64-gnu": "1.10.4",
+ "@node-rs/jieba-linux-x64-musl": "1.10.4",
+ "@node-rs/jieba-wasm32-wasi": "1.10.4",
+ "@node-rs/jieba-win32-arm64-msvc": "1.10.4",
+ "@node-rs/jieba-win32-ia32-msvc": "1.10.4",
+ "@node-rs/jieba-win32-x64-msvc": "1.10.4"
+ }
+ },
+ "node_modules/@node-rs/jieba-android-arm-eabi": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-android-arm-eabi/-/jieba-android-arm-eabi-1.10.4.tgz",
+ "integrity":
"sha512-MhyvW5N3Fwcp385d0rxbCWH42kqDBatQTyP8XbnYbju2+0BO/eTeCCLYj7Agws4pwxn2LtdldXRSKavT7WdzNA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-android-arm64": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-android-arm64/-/jieba-android-arm64-1.10.4.tgz",
+ "integrity":
"sha512-XyDwq5+rQ+Tk55A+FGi6PtJbzf974oqnpyCcCPzwU3QVXJCa2Rr4Lci+fx8oOpU4plT3GuD+chXMYLsXipMgJA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-darwin-arm64": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-darwin-arm64/-/jieba-darwin-arm64-1.10.4.tgz",
+ "integrity":
"sha512-G++RYEJ2jo0rxF9626KUy90wp06TRUjAsvY/BrIzEOX/ingQYV/HjwQzNPRR1P1o32a6/U8RGo7zEBhfdybL6w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-darwin-x64": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-darwin-x64/-/jieba-darwin-x64-1.10.4.tgz",
+ "integrity":
"sha512-MmDNeOb2TXIZCPyWCi2upQnZpPjAxw5ZGEj6R8kNsPXVFALHIKMa6ZZ15LCOkSTsKXVC17j2t4h+hSuyYb6qfQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-freebsd-x64": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-freebsd-x64/-/jieba-freebsd-x64-1.10.4.tgz",
+ "integrity":
"sha512-/x7aVQ8nqUWhpXU92RZqd333cq639i/olNpd9Z5hdlyyV5/B65LLy+Je2B2bfs62PVVm5QXRpeBcZqaHelp/bg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-linux-arm-gnueabihf": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-linux-arm-gnueabihf/-/jieba-linux-arm-gnueabihf-1.10.4.tgz",
+ "integrity":
"sha512-crd2M35oJBRLkoESs0O6QO3BBbhpv+tqXuKsqhIG94B1d02RVxtRIvSDwO33QurxqSdvN9IeSnVpHbDGkuXm3g==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-linux-arm64-gnu": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-linux-arm64-gnu/-/jieba-linux-arm64-gnu-1.10.4.tgz",
+ "integrity":
"sha512-omIzNX1psUzPcsdnUhGU6oHeOaTCuCjUgOA/v/DGkvWC1jLcnfXe4vdYbtXMh4XOCuIgS1UCcvZEc8vQLXFbXQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-linux-arm64-musl": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-linux-arm64-musl/-/jieba-linux-arm64-musl-1.10.4.tgz",
+ "integrity":
"sha512-Y/tiJ1+HeS5nnmLbZOE+66LbsPOHZ/PUckAYVeLlQfpygLEpLYdlh0aPpS5uiaWMjAXYZYdFkpZHhxDmSLpwpw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-linux-x64-gnu": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-linux-x64-gnu/-/jieba-linux-x64-gnu-1.10.4.tgz",
+ "integrity":
"sha512-WZO8ykRJpWGE9MHuZpy1lu3nJluPoeB+fIJJn5CWZ9YTVhNDWoCF4i/7nxz1ntulINYGQ8VVuCU9LD86Mek97g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-linux-x64-musl": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-linux-x64-musl/-/jieba-linux-x64-musl-1.10.4.tgz",
+ "integrity":
"sha512-uBBD4S1rGKcgCyAk6VCKatEVQb6EDD5I40v/DxODi5CuZVCANi9m5oee/MQbAoaX7RydA2f0OSCE9/tcwXEwUg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-wasm32-wasi": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-wasm32-wasi/-/jieba-wasm32-wasi-1.10.4.tgz",
+ "integrity":
"sha512-Y2umiKHjuIJy0uulNDz9SDYHdfq5Hmy7jY5nORO99B4pySKkcrMjpeVrmWXJLIsEKLJwcCXHxz8tjwU5/uhz0A==",
+ "cpu": [
+ "wasm32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@napi-rs/wasm-runtime": "^0.2.3"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@node-rs/jieba-win32-arm64-msvc": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-win32-arm64-msvc/-/jieba-win32-arm64-msvc-1.10.4.tgz",
+ "integrity":
"sha512-nwMtViFm4hjqhz1it/juQnxpXgqlGltCuWJ02bw70YUDMDlbyTy3grCJPpQQpueeETcALUnTxda8pZuVrLRcBA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-win32-ia32-msvc": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-win32-ia32-msvc/-/jieba-win32-ia32-msvc-1.10.4.tgz",
+ "integrity":
"sha512-DCAvLx7Z+W4z5oKS+7vUowAJr0uw9JBw8x1Y23Xs/xMA4Em+OOSiaF5/tCJqZUCJ8uC4QeImmgDFiBqGNwxlyA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@node-rs/jieba-win32-x64-msvc": {
+ "version": "1.10.4",
+ "resolved":
"https://registry.npmmirror.com/@node-rs/jieba-win32-x64-msvc/-/jieba-win32-x64-msvc-1.10.4.tgz",
+ "integrity":
"sha512-+sqemSfS1jjb+Tt7InNbNzrRh1Ua3vProVvC4BZRPg010/leCbGFFiQHpzcPRfpxAXZrzG5Y0YBTsPzN/I4yHQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"license": "MIT",
@@ -3370,6 +3739,17 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@tybys/wasm-util": {
+ "version": "0.9.0",
+ "resolved":
"https://registry.npmmirror.com/@tybys/wasm-util/-/wasm-util-0.9.0.tgz",
+ "integrity":
"sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
"node_modules/@types/body-parser": {
"version": "1.19.5",
"license": "MIT",
@@ -4558,19 +4938,25 @@
}
},
"node_modules/cheerio": {
- "version": "1.0.0-rc.12",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmmirror.com/cheerio/-/cheerio-1.0.0.tgz",
+ "integrity":
"sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==",
"license": "MIT",
"dependencies": {
"cheerio-select": "^2.1.0",
"dom-serializer": "^2.0.0",
"domhandler": "^5.0.3",
- "domutils": "^3.0.1",
- "htmlparser2": "^8.0.1",
- "parse5": "^7.0.0",
- "parse5-htmlparser2-tree-adapter": "^7.0.0"
+ "domutils": "^3.1.0",
+ "encoding-sniffer": "^0.2.0",
+ "htmlparser2": "^9.1.0",
+ "parse5": "^7.1.2",
+ "parse5-htmlparser2-tree-adapter": "^7.0.0",
+ "parse5-parser-stream": "^7.1.2",
+ "undici": "^6.19.5",
+ "whatwg-mimetype": "^4.0.0"
},
"engines": {
- "node": ">= 6"
+ "node": ">=18.17"
},
"funding": {
"url": "https://github.com/cheeriojs/cheerio?sponsor=1"
@@ -4664,6 +5050,8 @@
},
"node_modules/cheerio/node_modules/dom-serializer": {
"version": "2.0.0",
+ "resolved":
"https://registry.npmmirror.com/dom-serializer/-/dom-serializer-2.0.0.tgz",
+ "integrity":
"sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
"license": "MIT",
"dependencies": {
"domelementtype": "^2.3.0",
@@ -4676,6 +5064,8 @@
},
"node_modules/cheerio/node_modules/domhandler": {
"version": "5.0.3",
+ "resolved":
"https://registry.npmmirror.com/domhandler/-/domhandler-5.0.3.tgz",
+ "integrity":
"sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
"license": "BSD-2-Clause",
"dependencies": {
"domelementtype": "^2.3.0"
@@ -4688,7 +5078,9 @@
}
},
"node_modules/cheerio/node_modules/domutils": {
- "version": "3.1.0",
+ "version": "3.2.2",
+ "resolved":
"https://registry.npmmirror.com/domutils/-/domutils-3.2.2.tgz",
+ "integrity":
"sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==",
"license": "BSD-2-Clause",
"dependencies": {
"dom-serializer": "^2.0.0",
@@ -4701,6 +5093,8 @@
},
"node_modules/cheerio/node_modules/entities": {
"version": "4.5.0",
+ "resolved":
"https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz",
+ "integrity":
"sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=0.12"
@@ -4710,7 +5104,9 @@
}
},
"node_modules/cheerio/node_modules/htmlparser2": {
- "version": "8.0.2",
+ "version": "9.1.0",
+ "resolved":
"https://registry.npmmirror.com/htmlparser2/-/htmlparser2-9.1.0.tgz",
+ "integrity":
"sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==",
"funding": [
"https://github.com/fb55/htmlparser2?sponsor=1",
{
@@ -4722,8 +5118,8 @@
"dependencies": {
"domelementtype": "^2.3.0",
"domhandler": "^5.0.3",
- "domutils": "^3.0.1",
- "entities": "^4.4.0"
+ "domutils": "^3.1.0",
+ "entities": "^4.5.0"
}
},
"node_modules/chokidar": {
@@ -4875,6 +5271,13 @@
"node": ">=10"
}
},
+ "node_modules/comlink": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmmirror.com/comlink/-/comlink-4.4.2.tgz",
+ "integrity":
"sha512-OxGdvBmJuNKSCMO4NTl1L47VRp6xn2wG4F/2hYzB6tiCb709otOxtEYCSvK80PtjODfXXZu8ds+Nw5kVCjqd2g==",
+ "dev": true,
+ "license": "Apache-2.0"
+ },
"node_modules/comma-separated-tokens": {
"version": "1.0.8",
"license": "MIT",
@@ -5963,6 +6366,31 @@
"node": ">= 0.8"
}
},
+ "node_modules/encoding-sniffer": {
+ "version": "0.2.0",
+ "resolved":
"https://registry.npmmirror.com/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz",
+ "integrity":
"sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==",
+ "license": "MIT",
+ "dependencies": {
+ "iconv-lite": "^0.6.3",
+ "whatwg-encoding": "^3.1.1"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/encoding-sniffer?sponsor=1"
+ }
+ },
+ "node_modules/encoding-sniffer/node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved":
"https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity":
"sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/end-of-stream": {
"version": "1.4.4",
"license": "MIT",
@@ -6031,42 +6459,6 @@
"version": "1.5.2",
"license": "MIT"
},
- "node_modules/esbuild": {
- "version": "0.18.20",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "bin": {
- "esbuild": "bin/esbuild"
- },
- "engines": {
- "node": ">=12"
- },
- "optionalDependencies": {
- "@esbuild/android-arm": "0.18.20",
- "@esbuild/android-arm64": "0.18.20",
- "@esbuild/android-x64": "0.18.20",
- "@esbuild/darwin-arm64": "0.18.20",
- "@esbuild/darwin-x64": "0.18.20",
- "@esbuild/freebsd-arm64": "0.18.20",
- "@esbuild/freebsd-x64": "0.18.20",
- "@esbuild/linux-arm": "0.18.20",
- "@esbuild/linux-arm64": "0.18.20",
- "@esbuild/linux-ia32": "0.18.20",
- "@esbuild/linux-loong64": "0.18.20",
- "@esbuild/linux-mips64el": "0.18.20",
- "@esbuild/linux-ppc64": "0.18.20",
- "@esbuild/linux-riscv64": "0.18.20",
- "@esbuild/linux-s390x": "0.18.20",
- "@esbuild/linux-x64": "0.18.20",
- "@esbuild/netbsd-x64": "0.18.20",
- "@esbuild/openbsd-x64": "0.18.20",
- "@esbuild/sunos-x64": "0.18.20",
- "@esbuild/win32-arm64": "0.18.20",
- "@esbuild/win32-ia32": "0.18.20",
- "@esbuild/win32-x64": "0.18.20"
- }
- },
"node_modules/escalade": {
"version": "3.1.2",
"license": "MIT",
@@ -6836,17 +7228,6 @@
"node": ">=6"
}
},
- "node_modules/get-tsconfig": {
- "version": "4.7.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "resolve-pkg-maps": "^1.0.0"
- },
- "funding": {
- "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
- }
- },
"node_modules/github-slugger": {
"version": "1.5.0",
"license": "ISC"
@@ -7484,6 +7865,13 @@
"node": ">=16.x"
}
},
+ "node_modules/immediate": {
+ "version": "3.3.0",
+ "resolved":
"https://registry.npmmirror.com/immediate/-/immediate-3.3.0.tgz",
+ "integrity":
"sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/immer": {
"version": "9.0.21",
"license": "MIT",
@@ -8079,6 +8467,16 @@
"node": ">=0.10.0"
}
},
+ "node_modules/klaw-sync": {
+ "version": "6.0.0",
+ "resolved":
"https://registry.npmmirror.com/klaw-sync/-/klaw-sync-6.0.0.tgz",
+ "integrity":
"sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.1.11"
+ }
+ },
"node_modules/kleur": {
"version": "3.0.3",
"license": "MIT",
@@ -8295,6 +8693,20 @@
"node": ">=10"
}
},
+ "node_modules/lunr": {
+ "version": "2.3.9",
+ "resolved": "https://registry.npmmirror.com/lunr/-/lunr-2.3.9.tgz",
+ "integrity":
"sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/lunr-languages": {
+ "version": "1.14.0",
+ "resolved":
"https://registry.npmmirror.com/lunr-languages/-/lunr-languages-1.14.0.tgz",
+ "integrity":
"sha512-hWUAb2KqM3L7J5bcrngszzISY4BxrXn/Xhbb9TTCJYEGqlR1nG67/M14sp09+PTIRklobrn57IAxcdcO/ZFyNA==",
+ "dev": true,
+ "license": "MPL-1.1"
+ },
"node_modules/make-dir": {
"version": "3.1.0",
"license": "MIT",
@@ -8315,6 +8727,13 @@
"semver": "bin/semver.js"
}
},
+ "node_modules/mark.js": {
+ "version": "8.11.1",
+ "resolved":
"https://registry.npmmirror.com/mark.js/-/mark.js-8.11.1.tgz",
+ "integrity":
"sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/markdown-escapes": {
"version": "1.0.4",
"license": "MIT",
@@ -9034,6 +9453,18 @@
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
+ "node_modules/parse5-parser-stream": {
+ "version": "7.1.2",
+ "resolved":
"https://registry.npmmirror.com/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz",
+ "integrity":
"sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==",
+ "license": "MIT",
+ "dependencies": {
+ "parse5": "^7.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
"node_modules/parse5/node_modules/entities": {
"version": "4.5.0",
"license": "BSD-2-Clause",
@@ -10656,14 +11087,6 @@
"version": "3.0.0",
"license": "MIT"
},
- "node_modules/resolve-pkg-maps": {
- "version": "1.0.0",
- "dev": true,
- "license": "MIT",
- "funding": {
- "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
- }
- },
"node_modules/responselike": {
"version": "1.0.2",
"license": "MIT",
@@ -11605,22 +12028,6 @@
"version": "2.6.2",
"license": "0BSD"
},
- "node_modules/tsx": {
- "version": "3.14.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "esbuild": "~0.18.20",
- "get-tsconfig": "^4.7.2",
- "source-map-support": "^0.5.21"
- },
- "bin": {
- "tsx": "dist/cli.mjs"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.3"
- }
- },
"node_modules/type-fest": {
"version": "2.12.0",
"license": "(MIT OR CC0-1.0)",
@@ -11698,6 +12105,15 @@
"node": "*"
}
},
+ "node_modules/undici": {
+ "version": "6.21.2",
+ "resolved": "https://registry.npmmirror.com/undici/-/undici-6.21.2.tgz",
+ "integrity":
"sha512-uROZWze0R0itiAKVPsYhFov9LxrPMHLMEQFszeI2gCN6bnIIZ8twzBCJcN2LJrBBLfrP0t1FW0g+JmKVl8Vk1g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.17"
+ }
+ },
"node_modules/unherit": {
"version": "1.1.3",
"license": "MIT",
@@ -12795,6 +13211,39 @@
"node": ">=0.8.0"
}
},
+ "node_modules/whatwg-encoding": {
+ "version": "3.1.1",
+ "resolved":
"https://registry.npmmirror.com/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz",
+ "integrity":
"sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==",
+ "license": "MIT",
+ "dependencies": {
+ "iconv-lite": "0.6.3"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/whatwg-encoding/node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved":
"https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity":
"sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/whatwg-mimetype": {
+ "version": "4.0.0",
+ "resolved":
"https://registry.npmmirror.com/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz",
+ "integrity":
"sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/whatwg-url": {
"version": "5.0.0",
"license": "MIT",
diff --git a/package.json b/package.json
index b222a304aa5a..50e6bc7c719f 100644
--- a/package.json
+++ b/package.json
@@ -3,12 +3,12 @@
"version": "0.0.0",
"private": true,
"scripts": {
- "1": "npm run image-copy",
"docusaurus": "docusaurus",
- "sync": "tsx tools/build-docs.ts",
+ "sync": "node tools/build-docs.js",
"start": "docusaurus start",
"start-zh": "docusaurus start --locale zh-CN",
"build": "cross-env NODE_OPTIONS=--max_old_space_size=10240 docusaurus
build",
+ "build:fast": "cross-env NODE_OPTIONS=--max_old_space_size=10240
DOCUSAURUS_PARALLELIZE=true docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
@@ -16,15 +16,14 @@
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc",
- "image-copy": "tsx tools/image-copy.ts",
+ "image-copy": "node tools/image-copy.js",
"version-back": "npm run sync && docusaurus docs:version",
- "version": "tsx tools/version.ts"
+ "version": "node tools/version.js"
},
"dependencies": {
"@docusaurus/core": "^2.4.3",
"@docusaurus/plugin-content-docs": "^2.4.3",
"@docusaurus/preset-classic": "^2.4.3",
- "@docusaurus/theme-search-algolia": "^2.4.3",
"@mdx-js/react": "^1.6.22",
"@svgr/webpack": "^6.2.1",
"clsx": "^1.1.1",
@@ -36,6 +35,7 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.4.3",
+ "@easyops-cn/docusaurus-search-local": "^0.49.1",
"@tsconfig/docusaurus": "^1.0.4",
"@types/fs-extra": "^11.0.4",
"cross-env": "^7.0.3",
@@ -45,7 +45,6 @@
"less": "^4.1.2",
"less-loader": "^10.2.0",
"picocolors": "^1.0.1",
- "tsx": "^3.14.0",
"typescript": "^4.5.5"
},
"browserslist": {
diff --git a/tools/build-docs.ts b/tools/build-docs.js
similarity index 80%
rename from tools/build-docs.ts
rename to tools/build-docs.js
index db9851c95829..052c98265912 100644
--- a/tools/build-docs.ts
+++ b/tools/build-docs.js
@@ -1,7 +1,12 @@
-import * as child_process from "child_process";
-import * as fs from "fs";
-import { copySync } from "fs-extra";
-import {
+/**
+ * Tool script for building documentation
+ * @module build-docs
+ */
+
+const child_process = require("child_process");
+const fs = require("fs");
+const { copySync } = require("fs-extra");
+const {
PROJECT_NAME,
SWAP_DIR,
PROJECT_SITE_DOC_DIR,
@@ -18,7 +23,8 @@ import {
PROJECT_SITE_ZH_DOC_DIR,
PROJECT_SITE_ZH_DOC_IMG_DIR,
replaceImagesPath,
-} from "./common";
+} = require("./common");
+
const PROJECT_TAG_NAME = process.argv[2];
// Determine protocol mode
const PROTOCOL_MODE = process.env.PROTOCOL_MODE || "HTTP";
@@ -27,8 +33,11 @@ let PROJECT_REPO =
? `[email protected]:apache/${PROJECT_NAME}.git`
: `https://github.com/apache/${PROJECT_NAME}.git`;
-// Utility function to rebuild directories
-function rebuildDirs(...dirs: string[]) {
+/**
+ * Utility function to rebuild directories
+ * @param {...string} dirs - Directory paths to rebuild
+ */
+function rebuildDirs(...dirs) {
for (const dir of dirs) {
console.log(` ---> Rebuild directory ${dir}`);
if (fs.existsSync(dir)) {
@@ -38,8 +47,11 @@ function rebuildDirs(...dirs: string[]) {
}
}
-// Utility function to remove existing files
-function rmExistsFiles(...files: string[]) {
+/**
+ * Utility function to remove existing files
+ * @param {...string} files - File paths to remove
+ */
+function rmExistsFiles(...files) {
for (const file of files) {
console.log(` ---> Remove exists ${file}`);
if (fs.existsSync(file)) {
@@ -48,8 +60,13 @@ function rmExistsFiles(...files: string[]) {
}
}
-// Utility function to clone repository
-function cloneRepo(repo: string, branch: string, targetPath: string) {
+/**
+ * Utility function to clone repository
+ * @param {string} repo - Repository URL
+ * @param {string} branch - Branch name
+ * @param {string} targetPath - Target path
+ */
+function cloneRepo(repo, branch, targetPath) {
console.log(
` ---> Start clone repository ${repo} branch ${branch} to directory
${targetPath}`
);
@@ -58,7 +75,9 @@ function cloneRepo(repo: string, branch: string, targetPath:
string) {
);
}
-// Main function to prepare docs
+/**
+ * Main function to prepare documentation
+ */
function prepareDocs() {
console.log("===>>>: Start documents sync.");
diff --git a/tools/common.js b/tools/common.js
new file mode 100644
index 000000000000..130ed7f10226
--- /dev/null
+++ b/tools/common.js
@@ -0,0 +1,107 @@
+/**
+ * @typedef {Object} VersionConfig
+ * @property {Array<string>} VERSION - Array of version numbers
+ */
+
+const path = require("path");
+const fs = require("fs");
+const { readJsonSync } = require("fs-extra");
+
+// Set up constants
+/** @type {string} Source code path */
+const SOURCE_PATH = path.resolve(__dirname, "..");
+/** @type {string} Version config file path */
+const VERSION_FILE = path.resolve(
+ SOURCE_PATH,
+ "src",
+ "pages",
+ "versions",
+ "config.json"
+);
+/** @type {string} Project name */
+const PROJECT_NAME = "seatunnel";
+/** @type {string} Project branch name */
+const PROJECT_BRANCH_NAME = "dev";
+/** @type {string} Swap directory path */
+const SWAP_DIR = path.resolve(SOURCE_PATH, "swap");
+/** @type {string} Project site English image directory */
+const PROJECT_SITE_IMG_DIR = path.resolve(SOURCE_PATH, "static", "image_en");
+/** @type {string} Project site Chinese image directory */
+const PROJECT_SITE_ZH_IMG_DIR = path.resolve(SOURCE_PATH, "static",
"image_zh");
+/** @type {string} Project site document directory */
+const PROJECT_SITE_DOC_DIR = path.resolve(SOURCE_PATH, "docs");
+/** @type {string} Project site document image directory */
+const PROJECT_SITE_DOC_IMG_DIR = path.resolve(PROJECT_SITE_DOC_DIR, "images");
+/** @type {string} Project site Chinese document directory */
+const PROJECT_SITE_ZH_DOC_DIR = path.resolve(
+ SOURCE_PATH,
+ "i18n",
+ "zh-CN",
+ "docusaurus-plugin-content-docs",
+ "current"
+);
+/** @type {string} Project site Chinese document image directory */
+const PROJECT_SITE_ZH_DOC_IMG_DIR = path.resolve(
+ PROJECT_SITE_ZH_DOC_DIR,
+ "images"
+);
+/** @type {string} Project directory */
+const PROJECT_DIR = path.resolve(SWAP_DIR, PROJECT_NAME);
+/** @type {string} Project image directory */
+const PROJECT_IMG_DIR = path.resolve(PROJECT_DIR, "docs", "images");
+/** @type {string} Project English document directory */
+const PROJECT_DOC_DIR = path.resolve(PROJECT_DIR, "docs", "en");
+/** @type {string} Project Chinese document directory */
+const PROJECT_ZH_DOC_DIR = path.resolve(PROJECT_DIR, "docs", "zh");
+/** @type {string} Project sidebar path */
+const PROJECT_SIDEBAR_PATH = path.resolve(PROJECT_DIR, "docs", "sidebars.js");
+/** @type {string} Docusaurus document sidebar file */
+const DOCUSAURUS_DOC_SIDEBARS_FILE = path.resolve(SOURCE_PATH, "sidebars.js");
+/** @type {Array<string>} Array of version numbers */
+const VERSION = readJsonSync(path.resolve(SOURCE_PATH, "versions.json"));
+
+/**
+ * Utility function to replace image paths
+ * @param {string} replaceDir - Directory to process
+ * @param {string} [from="images"] - Original path
+ * @param {string} [to="images"] - Target path
+ */
+function replaceImagesPath(replaceDir, from = "images", to = "images") {
+ const regex = new RegExp(`../${from}`, "g");
+ for (const fileName of fs.readdirSync(replaceDir)) {
+ const filePath = path.resolve(replaceDir, fileName);
+ if (fs.statSync(filePath).isDirectory()) {
+ replaceImagesPath(filePath, from, to);
+ } else if (filePath.endsWith(".md") || filePath.endsWith(".mdx")) {
+ console.log(
+ ` ---> Replace images path form ${regex} to ${to} in ${filePath}`
+ );
+ let content = fs.readFileSync(filePath, "utf-8");
+ content = content.replace(regex, to);
+ content = content.replace(new RegExp(`(\\.)${to}`, "g"), `.io/${to}`);
+ fs.writeFileSync(filePath, content);
+ }
+ }
+}
+
+module.exports = {
+ SOURCE_PATH,
+ VERSION_FILE,
+ PROJECT_NAME,
+ PROJECT_BRANCH_NAME,
+ SWAP_DIR,
+ PROJECT_SITE_IMG_DIR,
+ PROJECT_SITE_ZH_IMG_DIR,
+ PROJECT_SITE_DOC_DIR,
+ PROJECT_SITE_DOC_IMG_DIR,
+ PROJECT_SITE_ZH_DOC_DIR,
+ PROJECT_SITE_ZH_DOC_IMG_DIR,
+ PROJECT_DIR,
+ PROJECT_IMG_DIR,
+ PROJECT_DOC_DIR,
+ PROJECT_ZH_DOC_DIR,
+ PROJECT_SIDEBAR_PATH,
+ DOCUSAURUS_DOC_SIDEBARS_FILE,
+ VERSION,
+ replaceImagesPath,
+};
diff --git a/tools/common.ts b/tools/common.ts
deleted file mode 100644
index 8dab1ca005fc..000000000000
--- a/tools/common.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import * as path from "path";
-import * as fs from "fs";
-import { readJsonSync } from "fs-extra";
-
-// Set up constants
-export const SOURCE_PATH = path.resolve(__dirname, "..");
-export const VERSION_FILE = path.resolve(
- SOURCE_PATH,
- "src",
- "pages",
- "versions",
- "config.json"
-);
-export const PROJECT_NAME = "seatunnel";
-export const PROJECT_BRANCH_NAME = "dev";
-export const SWAP_DIR = path.resolve(SOURCE_PATH, "swap");
-export const PROJECT_SITE_IMG_DIR = path.resolve(
- SOURCE_PATH,
- "static",
- "image_en"
-);
-export const PROJECT_SITE_ZH_IMG_DIR = path.resolve(
- SOURCE_PATH,
- "static",
- "image_zh"
-);
-export const PROJECT_SITE_DOC_DIR = path.resolve(SOURCE_PATH, "docs");
-export const PROJECT_SITE_DOC_IMG_DIR = path.resolve(PROJECT_SITE_DOC_DIR,
"images");
-export const PROJECT_SITE_ZH_DOC_DIR = path.resolve(
- SOURCE_PATH,
- "i18n",
- "zh-CN",
- "docusaurus-plugin-content-docs",
- "current"
-);
-export const PROJECT_SITE_ZH_DOC_IMG_DIR =
path.resolve(PROJECT_SITE_ZH_DOC_DIR, "images");
-export const PROJECT_DIR = path.resolve(SWAP_DIR, PROJECT_NAME);
-export const PROJECT_IMG_DIR = path.resolve(PROJECT_DIR, "docs", "images");
-export const PROJECT_DOC_DIR = path.resolve(PROJECT_DIR, "docs", "en");
-export const PROJECT_ZH_DOC_DIR = path.resolve(PROJECT_DIR, "docs", "zh");
-export const PROJECT_SIDEBAR_PATH = path.resolve(
- PROJECT_DIR,
- "docs",
- "sidebars.js"
-);
-export const DOCUSAURUS_DOC_SIDEBARS_FILE = path.resolve(
- SOURCE_PATH,
- "sidebars.js"
-);
-export const VERSION = readJsonSync(path.resolve(SOURCE_PATH,
"versions.json"));
-
-// Utility function to replace image paths
-export function replaceImagesPath(
- replaceDir: string,
- from: string = "images",
- to: string = "images"
-) {
- const regex = new RegExp(`../${from}`, "g");
- for (const fileName of fs.readdirSync(replaceDir)) {
- const filePath = path.resolve(replaceDir, fileName);
- if (fs.statSync(filePath).isDirectory()) {
- replaceImagesPath(filePath, from, to);
- } else if (filePath.endsWith(".md") || filePath.endsWith(".mdx")) {
- console.log(
- ` ---> Replace images path form ${regex} to ${to} in ${filePath}`
- );
- let content = fs.readFileSync(filePath, "utf-8");
- content = content.replace(regex, to)
- content = content.replace(new RegExp(`(\\.)${to}`, "g"), `.io/${to}`);
- fs.writeFileSync(filePath, content);
- }
- }
-}
diff --git a/tools/image-copy.ts b/tools/image-copy.js
similarity index 51%
rename from tools/image-copy.ts
rename to tools/image-copy.js
index e1849b60c005..6467db8f31dc 100644
--- a/tools/image-copy.ts
+++ b/tools/image-copy.js
@@ -1,27 +1,48 @@
-import * as path from "path";
-import { copySync } from "fs-extra";
-import {
+/**
+ * Image copy tool script
+ * @module image-copy
+ */
+
+const path = require("path");
+const { copySync } = require("fs-extra");
+const {
VERSION,
PROJECT_SITE_IMG_DIR,
PROJECT_SITE_ZH_IMG_DIR,
SOURCE_PATH,
replaceImagesPath,
-} from "./common";
+} = require("./common");
+/** @type {string} Versioned docs directory */
const versionedDir = path.join(SOURCE_PATH, "versioned_docs");
+/** @type {string} Versioned Chinese docs directory */
const versionedZHDir = path.join(
SOURCE_PATH,
"i18n/zh-CN/docusaurus-plugin-content-docs"
);
-const resolveVersionedImageDir = (version: string) =>
+/**
+ * Parse versioned image directory
+ * @param {string} version - Version number
+ * @returns {string} Versioned image directory path
+ */
+const resolveVersionedImageDir = (version) =>
path.join(versionedDir, `version-${version}`);
-const resolveVersionedZHImageDir = (version: string) =>
+/**
+ * Parse versioned Chinese image directory
+ * @param {string} version - Version number
+ * @returns {string} Versioned Chinese image directory path
+ */
+const resolveVersionedZHImageDir = (version) =>
path.join(versionedZHDir, `version-${version}`);
+/** @type {string} Image directory name */
const IMAGEDIR = "images";
+/**
+ * Copy and replace image paths
+ */
function copyAndReplaceImagesPath() {
const newVersion = VERSION[0];
const newVersionedDir = resolveVersionedImageDir(newVersion);
@@ -35,8 +56,8 @@ function copyAndReplaceImagesPath() {
);
// replace images path in versioned docs
-// replaceImagesPath(newVersionedDir, `${IMAGEDIR}`, "/image_en");
-// replaceImagesPath(newVersionedZHDir, `${IMAGEDIR}`, "/image_zh");
+ // replaceImagesPath(newVersionedDir, `${IMAGEDIR}`, "/image_en");
+ // replaceImagesPath(newVersionedZHDir, `${IMAGEDIR}`, "/image_zh");
}
copyAndReplaceImagesPath();
diff --git a/tools/version.ts b/tools/version.js
similarity index 81%
rename from tools/version.ts
rename to tools/version.js
index dcdca1ce8af4..2b6c163a9e48 100644
--- a/tools/version.ts
+++ b/tools/version.js
@@ -1,10 +1,20 @@
-import { execa } from "execa";
-import { readJSONSync, writeJSONSync } from "fs-extra";
-import { VERSION_FILE } from "./common";
-import color from "picocolors";
+/**
+ * Version management tool script
+ * @module version
+ */
+const { execa } = require("execa");
+const { readJSONSync, writeJSONSync } = require("fs-extra");
+const { VERSION_FILE } = require("./common");
+const color = require("picocolors");
+
+/** @type {string} Version number */
const version = process.argv[2];
+/**
+ * Step Four: Update version configuration file
+ * @async
+ */
async function stepFour() {
const json = readJSONSync(VERSION_FILE);
const current = {
@@ -24,6 +34,10 @@ async function stepFour() {
writeJSONSync(VERSION_FILE, json, { spaces: 2 });
}
+/**
+ * Main function
+ * @async
+ */
async function main() {
if (!version) {
throw new Error("Missing version number");
diff --git a/tsconfig.json b/tsconfig.json
index 1dec247560e9..6f4756980d4d 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -3,8 +3,5 @@
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
"baseUrl": "."
- },
- "include": [
- "tools"
- ]
-}
\ No newline at end of file
+ }
+}