From a2fa755b62e0fcf33b450f5cc9df5eea8fef4fb0 Mon Sep 17 00:00:00 2001 From: skycurtain Date: Tue, 6 Oct 2026 01:30:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20antdv-next=20=C2=A73.7=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E8=83=BD=E5=8A=9B=20spike?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit create-vue + antdv-next 覆盖侧边栏/展开行/对话框/范围选择/徽章等验收清单。 --- apps/web/.editorconfig | 8 ++ apps/web/.gitattributes | 1 + apps/web/.gitignore | 39 ++++++++ apps/web/.oxlintrc.json | 10 +++ apps/web/.prettierrc.json | 6 ++ apps/web/README.md | 54 +++++++++++ apps/web/env.d.ts | 1 + apps/web/eslint.config.ts | 32 +++++++ apps/web/index.html | 12 +++ apps/web/package.json | 54 +++++++++++ apps/web/public/favicon.ico | Bin 0 -> 4286 bytes apps/web/src/App.vue | 168 +++++++++++++++++++++++++++++++++++ apps/web/src/assets/main.css | 8 ++ apps/web/src/main.ts | 9 ++ apps/web/tsconfig.app.json | 18 ++++ apps/web/tsconfig.json | 11 +++ apps/web/tsconfig.node.json | 28 ++++++ apps/web/vite.config.ts | 20 +++++ 18 files changed, 479 insertions(+) create mode 100644 apps/web/.editorconfig create mode 100644 apps/web/.gitattributes create mode 100644 apps/web/.gitignore create mode 100644 apps/web/.oxlintrc.json create mode 100644 apps/web/.prettierrc.json create mode 100644 apps/web/README.md create mode 100644 apps/web/env.d.ts create mode 100644 apps/web/eslint.config.ts create mode 100644 apps/web/index.html create mode 100644 apps/web/package.json create mode 100644 apps/web/public/favicon.ico create mode 100644 apps/web/src/App.vue create mode 100644 apps/web/src/assets/main.css create mode 100644 apps/web/src/main.ts create mode 100644 apps/web/tsconfig.app.json create mode 100644 apps/web/tsconfig.json create mode 100644 apps/web/tsconfig.node.json create mode 100644 apps/web/vite.config.ts diff --git a/apps/web/.editorconfig b/apps/web/.editorconfig new file mode 100644 index 0000000..3b510aa --- /dev/null +++ b/apps/web/.editorconfig @@ -0,0 +1,8 @@ +[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}] +charset = utf-8 +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf +max_line_length = 100 diff --git a/apps/web/.gitattributes b/apps/web/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/apps/web/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/apps/web/.gitignore b/apps/web/.gitignore new file mode 100644 index 0000000..cd68f14 --- /dev/null +++ b/apps/web/.gitignore @@ -0,0 +1,39 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo + +.eslintcache + +# Cypress +/cypress/videos/ +/cypress/screenshots/ + +# Vitest +__screenshots__/ + +# Vite +*.timestamp-*-*.mjs diff --git a/apps/web/.oxlintrc.json b/apps/web/.oxlintrc.json new file mode 100644 index 0000000..86b5cc2 --- /dev/null +++ b/apps/web/.oxlintrc.json @@ -0,0 +1,10 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["eslint", "typescript", "unicorn", "oxc", "vue", "vitest"], + "env": { + "browser": true + }, + "categories": { + "correctness": "error" + } +} diff --git a/apps/web/.prettierrc.json b/apps/web/.prettierrc.json new file mode 100644 index 0000000..29a2402 --- /dev/null +++ b/apps/web/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": false, + "singleQuote": true, + "printWidth": 100 +} diff --git a/apps/web/README.md b/apps/web/README.md new file mode 100644 index 0000000..9894445 --- /dev/null +++ b/apps/web/README.md @@ -0,0 +1,54 @@ +# apps/web + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). + +## Recommended Browser Setup + +- Chromium-based browsers (Chrome, Edge, Brave, etc.): + - [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) + - [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters) +- Firefox: + - [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/) + - [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/) + +## Type Support for `.vue` Imports in TS + +TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. + +## Customize configuration + +See [Vite Configuration Reference](https://vite.dev/config/). + +## Project Setup + +```sh +bun install +``` + +### Compile and Hot-Reload for Development + +```sh +bun dev +``` + +### Type-Check, Compile and Minify for Production + +```sh +bun run build +``` + +### Run Unit Tests with [Vitest](https://vitest.dev/) + +```sh +bun test:unit +``` + +### Lint with [ESLint](https://eslint.org/) + +```sh +bun lint +``` diff --git a/apps/web/env.d.ts b/apps/web/env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/apps/web/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/apps/web/eslint.config.ts b/apps/web/eslint.config.ts new file mode 100644 index 0000000..4e90ef7 --- /dev/null +++ b/apps/web/eslint.config.ts @@ -0,0 +1,32 @@ +import { globalIgnores } from 'eslint/config' +import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript' +import pluginVue from 'eslint-plugin-vue' +import pluginVitest from '@vitest/eslint-plugin' +import pluginOxlint from 'eslint-plugin-oxlint' +import skipFormatting from 'eslint-config-prettier/flat' + +// To allow more languages other than `ts` in `.vue` files, uncomment the following lines: +// import { configureVueProject } from '@vue/eslint-config-typescript' +// configureVueProject({ scriptLangs: ['ts', 'tsx'] }) +// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup + +export default defineConfigWithVueTs( + { + name: 'app/files-to-lint', + files: ['**/*.{vue,ts,mts,tsx}'], + }, + + globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']), + + ...pluginVue.configs['flat/essential'], + vueTsConfigs.recommended, + + { + ...pluginVitest.configs.recommended, + files: ['src/**/__tests__/*'], + }, + + ...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'), + + skipFormatting, +) diff --git a/apps/web/index.html b/apps/web/index.html new file mode 100644 index 0000000..0666888 --- /dev/null +++ b/apps/web/index.html @@ -0,0 +1,12 @@ + + + + + + antdv-next §3.7 能力 spike + + +
+ + + diff --git a/apps/web/package.json b/apps/web/package.json new file mode 100644 index 0000000..59fcb02 --- /dev/null +++ b/apps/web/package.json @@ -0,0 +1,54 @@ +{ + "name": "@new-api-key-usage/web", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "run-p type-check \"build-only {@}\" --", + "preview": "vite preview", + "test:unit": "vitest", + "build-only": "vite build", + "type-check": "vue-tsc --build", + "lint": "run-s \"lint:*\"", + "lint:oxlint": "oxlint . --fix", + "lint:eslint": "eslint . --fix --cache", + "format": "prettier --write --experimental-cli src/" + }, + "dependencies": { + "@new-api-key-usage/core": "workspace:*", + "antdv-next": "^1.6.0", + "pinia": "^4.0.3", + "vue": "^3.5.42", + "vue-router": "^5.3.1" + }, + "devDependencies": { + "@tsconfig/node24": "^24.0.5", + "@types/jsdom": "^30.0.0", + "@types/node": "^24.13.4", + "@vitejs/plugin-vue": "^6.0.8", + "@vitejs/plugin-vue-jsx": "^5.1.6", + "@vitest/eslint-plugin": "^1.6.27", + "@vue/eslint-config-typescript": "^14.9.0", + "@vue/test-utils": "^2.5.0", + "@vue/tsconfig": "^0.9.1", + "eslint": "^10.10.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-oxlint": "~1.82.0", + "eslint-plugin-vue": "~10.11.0", + "jiti": "^2.7.0", + "jsdom": "^30.0.1", + "npm-run-all2": "^9.0.3", + "oxlint": "~1.82.0", + "prettier": "3.9.6", + "typescript": "~6.0.0", + "vite": "^8.2.2", + "vite-plugin-vue-devtools": "^8.2.1", + "vitest": "^4.1.11", + "vue-eslint-parser": "^10.4.1", + "vue-tsc": "^3.3.11" + }, + "engines": { + "node": "^22.18.0 || >=24.12.0" + } +} diff --git a/apps/web/public/favicon.ico b/apps/web/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zcmds*O-Phc6o&64GDVCEQHxsW(p4>LW*W<827=Unuo8sGpRux(DN@jWP-e29Wl%wj zY84_aq9}^Am9-cWTD5GGEo#+5Fi2wX_P*bo+xO!)p*7B;iKlbFd(U~_d(U?#hLj56 zPhFkj-|A6~Qk#@g^#D^U0XT1cu=c-vu1+SElX9NR;kzAUV(q0|dl0|%h|dI$%VICy zJnu2^L*Te9JrJMGh%-P79CL0}dq92RGU6gI{v2~|)p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kevtV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S literal 0 HcmV?d00001 diff --git a/apps/web/src/App.vue b/apps/web/src/App.vue new file mode 100644 index 0000000..f669321 --- /dev/null +++ b/apps/web/src/App.vue @@ -0,0 +1,168 @@ + + + diff --git a/apps/web/src/assets/main.css b/apps/web/src/assets/main.css new file mode 100644 index 0000000..0fac6a5 --- /dev/null +++ b/apps/web/src/assets/main.css @@ -0,0 +1,8 @@ +body { + margin: 0; + font-family: + -apple-system, + "PingFang SC", + "Microsoft YaHei", + sans-serif; +} diff --git a/apps/web/src/main.ts b/apps/web/src/main.ts new file mode 100644 index 0000000..df572e4 --- /dev/null +++ b/apps/web/src/main.ts @@ -0,0 +1,9 @@ +import { createApp } from "vue"; +import Antd from "antdv-next"; +import "antdv-next/dist/reset.css"; +import App from "./App.vue"; +import "./assets/main.css"; + +const app = createApp(App); +app.use(Antd); +app.mount("#app"); diff --git a/apps/web/tsconfig.app.json b/apps/web/tsconfig.app.json new file mode 100644 index 0000000..c0f2d86 --- /dev/null +++ b/apps/web/tsconfig.app.json @@ -0,0 +1,18 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/*"], + "compilerOptions": { + // Extra safety for array and object lookups, but may have false positives. + "noUncheckedIndexedAccess": true, + + // Path mapping for cleaner imports. + "paths": { + "@/*": ["./src/*"] + }, + + // `vue-tsc --build` produces a .tsbuildinfo file for incremental type-checking. + // Specified here to keep it out of the root directory. + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo" + } +} diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json new file mode 100644 index 0000000..66b5e57 --- /dev/null +++ b/apps/web/tsconfig.json @@ -0,0 +1,11 @@ +{ + "files": [], + "references": [ + { + "path": "./tsconfig.node.json" + }, + { + "path": "./tsconfig.app.json" + } + ] +} diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json new file mode 100644 index 0000000..7274bd4 --- /dev/null +++ b/apps/web/tsconfig.node.json @@ -0,0 +1,28 @@ +// TSConfig for modules that run in Node.js environment via either transpilation or type-stripping. +{ + "extends": "@tsconfig/node24/tsconfig.json", + "include": [ + "vite.config.*", + "vitest.config.*", + "cypress.config.*", + "playwright.config.*", + "eslint.config.*" + ], + "compilerOptions": { + // Most tools use transpilation instead of Node.js's native type-stripping. + // Bundler mode provides a smoother developer experience. + "module": "preserve", + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + + // Include Node.js types and avoid accidentally including other `@types/*` packages. + "types": ["node"], + + // Disable emitting output during `vue-tsc --build`, which is used for type-checking only. + "noEmit": true, + + // `vue-tsc --build` produces a .tsbuildinfo file for incremental type-checking. + // Specified here to keep it out of the root directory. + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo" + } +} diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts new file mode 100644 index 0000000..ace127e --- /dev/null +++ b/apps/web/vite.config.ts @@ -0,0 +1,20 @@ +import { fileURLToPath, URL } from 'node:url' + +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' +import vueDevTools from 'vite-plugin-vue-devtools' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [ + vue(), + vueJsx(), + vueDevTools(), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, + }, +})