From 3bc237db9100864f2813249ac1693735a658e646 Mon Sep 17 00:00:00 2001 From: Yue JIN Date: Thu, 7 Aug 2025 16:32:26 +0800 Subject: [PATCH] remove docs script let cdn to redirect for us --- README.md | 10 +++------ README.zh-Hans.md | 10 +++------ package.json | 6 ++---- pnpm-lock.yaml | 49 ++++++++++++++++++-------------------------- scripts/docs.ts | 51 ---------------------------------------------- scripts/utils.ts | 20 ------------------ tsconfig.node.json | 2 +- 7 files changed, 29 insertions(+), 119 deletions(-) delete mode 100644 scripts/docs.ts delete mode 100644 scripts/utils.ts diff --git a/README.md b/README.md index 853baf2..a1efe26 100644 --- a/README.md +++ b/README.md @@ -116,16 +116,12 @@ Drop ` - - + + + ``` - - ```js const app = Vue.createApp(...) diff --git a/README.zh-Hans.md b/README.zh-Hans.md index 6801735..7df5553 100644 --- a/README.zh-Hans.md +++ b/README.zh-Hans.md @@ -116,16 +116,12 @@ import "echarts";
Vue 3 Demo → - - ```html - - - + + + ``` - - ```js const app = Vue.createApp(...) diff --git a/package.json b/package.json index 9b138a1..ba511b4 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "author": "GU Yiling ", "scripts": { "dev": "vite", - "build": "pnpm run docs && tsdown", + "build": "tsdown", "typecheck": "tsc", "lint": "eslint . --fix", "format": "prettier . --write", @@ -18,7 +18,6 @@ "dev:build": "vite build", "dev:preview": "vite preview", "dev:typecheck": "vue-tsc -p ./demo", - "docs": "jiti ./scripts/docs.ts", "prepublishOnly": "pnpm run typecheck && pnpm run dev:typecheck && pnpm run build && publint" }, "packageManager": "pnpm@10.14.0", @@ -48,7 +47,6 @@ "@vue/eslint-config-typescript": "^14.6.0", "@vue/tsconfig": "^0.7.0", "@vueuse/core": "^13.6.0", - "comment-mark": "^2.0.1", "echarts": "^6.0.0", "echarts-gl": "^2.0.9", "echarts-liquidfill": "^3.1.0", @@ -64,7 +62,7 @@ "tsdown": "^0.13.3", "typescript": "^5.9.2", "unplugin-raw": "^0.5.1", - "vite": "npm:rolldown-vite@7.1.0-beta.0", + "vite": "npm:rolldown-vite@^7.1.0", "vue": "^3.5.18", "vue-tsc": "^3.0.5" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8c021c0..a4295a7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: version: 1.5.0(vue@3.5.18(typescript@5.9.2)) '@vitejs/plugin-vue': specifier: ^6.0.1 - version: 6.0.1(rolldown-vite@7.1.0-beta.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4))(vue@3.5.18(typescript@5.9.2)) + version: 6.0.1(rolldown-vite@7.1.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4))(vue@3.5.18(typescript@5.9.2)) '@vue/eslint-config-prettier': specifier: ^10.2.0 version: 10.2.0(@types/eslint@8.56.10)(eslint@9.32.0(jiti@2.5.1))(prettier@3.6.2) @@ -35,9 +35,6 @@ importers: '@vueuse/core': specifier: ^13.6.0 version: 13.6.0(vue@3.5.18(typescript@5.9.2)) - comment-mark: - specifier: ^2.0.1 - version: 2.0.1 echarts: specifier: ^6.0.0 version: 6.0.0 @@ -84,8 +81,8 @@ importers: specifier: ^0.5.1 version: 0.5.1 vite: - specifier: npm:rolldown-vite@7.1.0-beta.0 - version: rolldown-vite@7.1.0-beta.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4) + specifier: npm:rolldown-vite@^7.1.0 + version: rolldown-vite@7.1.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4) vue: specifier: ^3.5.18 version: 3.5.18(typescript@5.9.2) @@ -766,10 +763,6 @@ packages: commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} - comment-mark@2.0.1: - resolution: {integrity: sha512-WObl+IX0fmiQYgt/pMTquyAYBdcKf8GQGPVPDNtL7XvDQDUdfHaOJYayzsLGS24GHLuHhFXgVXmwwq6CM1lHcQ==} - engines: {node: '>=20'} - concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -865,8 +858,8 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-plugin-prettier@5.5.3: - resolution: {integrity: sha512-NAdMYww51ehKfDyDhv59/eIItUVzU0Io9H2E8nHNGKEeeqlnci+1gCvrHib6EmZdf6GxF+LCV5K7UC65Ezvw7w==} + eslint-plugin-prettier@5.5.4: + resolution: {integrity: sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -1320,8 +1313,8 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rolldown-plugin-dts@0.15.3: - resolution: {integrity: sha512-qILn8tXV828UpzgSN7R3KeCl1lfc2eRhPJDGO78C6PztEQH51gBTG3tyQDIVIAYY58afhOsWW/zTYpfewTGCdg==} + rolldown-plugin-dts@0.15.5: + resolution: {integrity: sha512-YlgrK2oihea16LNXG0nUaNkb82SvbOmyhKpoid1M4Wehz6Bqkw1ZfZrUaBubIAt9M1up/Ku5EArGh7OSqA3tKA==} engines: {node: '>=20.18.0'} peerDependencies: '@typescript/native-preview': '>=7.0.0-dev.20250601.1' @@ -1336,8 +1329,8 @@ packages: vue-tsc: optional: true - rolldown-vite@7.1.0-beta.0: - resolution: {integrity: sha512-P88FHLuBJn+UuKZCMRYB1AoDOYYI6PEMZSQV93p/ojNBDnrQMmYWs+4Fq1+PQnZJ6Gs/aalD7ZNdrPdjCIGOQQ==} + rolldown-vite@7.1.0: + resolution: {integrity: sha512-DCfutVwSkuc3NA75SdFuetKwcpq97tO2JZdM6gYv7GwW6/9qyXnITYER+8zrJt+vQVGP2SadAkMOpWw7B4LVwg==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -1511,8 +1504,8 @@ packages: resolution: {integrity: sha512-2ILiUssvvtNiPnOT/8+xw7FJQ1BrRUZtnzHyujUPNudhPSvAzkcWzaUDp12SAkne3Tr1y7+ctoF9dEUktJNtlw==} engines: {node: '>=20.18.0'} - unplugin-utils@0.2.4: - resolution: {integrity: sha512-8U/MtpkPkkk3Atewj1+RcKIjb5WBimZ/WSLhhR3w6SsIj8XJuKTacSP8g+2JhfSGw0Cb125Y+2zA/IzJZDVbhA==} + unplugin-utils@0.2.5: + resolution: {integrity: sha512-gwXJnPRewT4rT7sBi/IvxKTjsms7jX7QIDLOClApuZwR49SXbrB1z2NLUZ+vDHyqCj/n58OzRRqaW+B8OZi8vg==} engines: {node: '>=18.12.0'} unplugin@2.3.5: @@ -1970,10 +1963,10 @@ snapshots: optionalDependencies: vue: 3.5.18(typescript@5.9.2) - '@vitejs/plugin-vue@6.0.1(rolldown-vite@7.1.0-beta.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4))(vue@3.5.18(typescript@5.9.2))': + '@vitejs/plugin-vue@6.0.1(rolldown-vite@7.1.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4))(vue@3.5.18(typescript@5.9.2))': dependencies: '@rolldown/pluginutils': 1.0.0-beta.29 - vite: rolldown-vite@7.1.0-beta.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4) + vite: rolldown-vite@7.1.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4) vue: 3.5.18(typescript@5.9.2) '@volar/language-core@2.4.22': @@ -2045,7 +2038,7 @@ snapshots: dependencies: eslint: 9.32.0(jiti@2.5.1) eslint-config-prettier: 10.1.8(eslint@9.32.0(jiti@2.5.1)) - eslint-plugin-prettier: 5.5.3(@types/eslint@8.56.10)(eslint-config-prettier@10.1.8(eslint@9.32.0(jiti@2.5.1)))(eslint@9.32.0(jiti@2.5.1))(prettier@3.6.2) + eslint-plugin-prettier: 5.5.4(@types/eslint@8.56.10)(eslint-config-prettier@10.1.8(eslint@9.32.0(jiti@2.5.1)))(eslint@9.32.0(jiti@2.5.1))(prettier@3.6.2) prettier: 3.6.2 transitivePeerDependencies: - '@types/eslint' @@ -2192,8 +2185,6 @@ snapshots: commander@2.20.3: optional: true - comment-mark@2.0.1: {} - concat-map@0.0.1: {} copy-anything@3.0.5: @@ -2282,7 +2273,7 @@ snapshots: dependencies: eslint: 9.32.0(jiti@2.5.1) - eslint-plugin-prettier@5.5.3(@types/eslint@8.56.10)(eslint-config-prettier@10.1.8(eslint@9.32.0(jiti@2.5.1)))(eslint@9.32.0(jiti@2.5.1))(prettier@3.6.2): + eslint-plugin-prettier@5.5.4(@types/eslint@8.56.10)(eslint-config-prettier@10.1.8(eslint@9.32.0(jiti@2.5.1)))(eslint@9.32.0(jiti@2.5.1))(prettier@3.6.2): dependencies: eslint: 9.32.0(jiti@2.5.1) prettier: 3.6.2 @@ -2677,7 +2668,7 @@ snapshots: rfdc@1.4.1: {} - rolldown-plugin-dts@0.15.3(rolldown@1.0.0-beta.31)(typescript@5.9.2)(vue-tsc@3.0.5(typescript@5.9.2)): + rolldown-plugin-dts@0.15.5(rolldown@1.0.0-beta.31)(typescript@5.9.2)(vue-tsc@3.0.5(typescript@5.9.2)): dependencies: '@babel/generator': 7.28.0 '@babel/parser': 7.28.0 @@ -2695,7 +2686,7 @@ snapshots: - oxc-resolver - supports-color - rolldown-vite@7.1.0-beta.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4): + rolldown-vite@7.1.0(@types/node@22.17.0)(esbuild@0.25.8)(jiti@2.5.1)(terser@5.30.4): dependencies: fdir: 6.4.6(picomatch@4.0.3) lightningcss: 1.30.1 @@ -2810,7 +2801,7 @@ snapshots: empathic: 2.0.0 hookable: 5.5.3 rolldown: 1.0.0-beta.31 - rolldown-plugin-dts: 0.15.3(rolldown@1.0.0-beta.31)(typescript@5.9.2)(vue-tsc@3.0.5(typescript@5.9.2)) + rolldown-plugin-dts: 0.15.5(rolldown@1.0.0-beta.31)(typescript@5.9.2)(vue-tsc@3.0.5(typescript@5.9.2)) semver: 7.7.2 tinyexec: 1.0.1 tinyglobby: 0.2.14 @@ -2860,9 +2851,9 @@ snapshots: dependencies: esbuild: 0.25.8 unplugin: 2.3.5 - unplugin-utils: 0.2.4 + unplugin-utils: 0.2.5 - unplugin-utils@0.2.4: + unplugin-utils@0.2.5: dependencies: pathe: 2.0.3 picomatch: 4.0.3 diff --git a/scripts/docs.ts b/scripts/docs.ts deleted file mode 100644 index 5e6dee9..0000000 --- a/scripts/docs.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { readFileSync, writeFileSync } from "node:fs"; -import { commentMark } from "comment-mark"; -import { getPackageVersions, resolvePath } from "./utils"; - -const { name, version, devDependencies } = getPackageVersions([ - "echarts", - "vue", -]); - -const CDN_PREFIX = "https://cdn.jsdelivr.net/npm/"; - -const DEP_VERSIONS = { - ...Object.fromEntries( - Object.entries(devDependencies).map(([name, { version }]) => [ - name, - version, - ]), - ), - [name]: version, -}; - -function getScripts() { - return Object.entries(DEP_VERSIONS) - .map(([dep, version]) => { - const [, name] = dep.match(/^(.+?)(?:@.+)?$/) || []; - return ``; - }) - .join("\n"); -} - -function getCodeBlock(code: string) { - return "\n```html\n" + code + "\n```\n"; -} - -const README_FILES = ["README.md", "README.zh-Hans.md"].map((name) => - resolvePath(import.meta.url, "..", name), -); - -README_FILES.forEach((file) => { - const content = readFileSync(file, "utf8"); - - writeFileSync( - file, - commentMark(content, { - vue3Scripts: getCodeBlock(getScripts()), - }), - "utf8", - ); -}); - -console.log("README files updated."); diff --git a/scripts/utils.ts b/scripts/utils.ts deleted file mode 100644 index d098097..0000000 --- a/scripts/utils.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { execSync } from "node:child_process"; -import { resolve, dirname } from "node:path"; -import { fileURLToPath } from "node:url"; - -export function resolvePath(url: string, ...parts: string[]) { - return resolve(dirname(fileURLToPath(url)), ...parts); -} - -type PackageVersions = { - name: string; - version: string; - devDependencies: Record; -}; - -export function getPackageVersions(devDeps?: string[]): PackageVersions { - const stdOut = execSync(`pnpm ls ${devDeps?.join(" ") || ""} --json`, { - encoding: "utf-8", - }); - return JSON.parse(stdOut)[0]; -} diff --git a/tsconfig.node.json b/tsconfig.node.json index 76b9563..695006f 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -1,5 +1,5 @@ { - "include": ["*.config.*", "scripts/**/*"], + "include": ["*.config.*"], "compilerOptions": { "composite": true, "lib": ["ESNext"],