From 243a22794cd6bfdb05a9d87827408408f42fbdd6 Mon Sep 17 00:00:00 2001 From: rex Date: Wed, 26 Nov 2025 13:27:04 +0800 Subject: [PATCH] doc --- package.json | 3 +- pnpm-lock.yaml | 154 ++++++++++++++++++++++++++++++-- src/components/Button/index.tsx | 19 ++++ src/components/index.ts | 1 + src/main.tsx | 2 +- src/pages/about/index.css | 0 src/pages/about/index.tsx | 16 +++- src/pages/home/index.css | 1 + src/pages/home/index.tsx | 17 ++-- src/styles/global.css | 2 + 10 files changed, 197 insertions(+), 18 deletions(-) create mode 100644 src/components/Button/index.tsx delete mode 100644 src/pages/about/index.css diff --git a/package.json b/package.json index a29f685..db232f3 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,13 @@ }, "packageManager": "pnpm@10.0.0", "scripts": { - "mujian": "mujian hello world", "dev": "vite", "build": "tsc -b && vite build", "lint": "biome check --write ./src", "preview": "vite preview" }, "dependencies": { - "@mujian/js-sdk": "^0.0.1", + "@mujian/js-sdk": "^0.0.6-beta.36", "@tailwindcss/vite": "^4.1.12", "axios": "^1.11.0", "dayjs": "^1.11.18", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8765b43..170483e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@mujian/js-sdk': - specifier: ^0.0.1 - version: 0.0.1 + specifier: ^0.0.6-beta.36 + version: 0.0.6-beta.36(react-dom@19.1.1(react@19.1.1))(react@19.1.1) '@tailwindcss/vite': specifier: ^4.1.12 version: 4.1.12(vite@7.1.3(@types/node@22.18.0)(jiti@2.5.1)(lightningcss@1.30.1)) @@ -78,6 +78,9 @@ importers: packages: + '@adobe/css-tools@4.4.4': + resolution: {integrity: sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==} + '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} @@ -153,6 +156,10 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/runtime@7.28.4': + resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} + engines: {node: '>=6.9.0'} + '@babel/template@7.27.2': resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} @@ -346,8 +353,11 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - '@mujian/js-sdk@0.0.1': - resolution: {integrity: sha512-tJK+VL6pfsb5Gmoqtlb9yuYaX2p0SGoYxqS/8reKbu5uI7pK9uO9rHU+A7z94YCwOIDdiIefNCCrtgbTcMVMfg==} + '@mujian/js-sdk@0.0.6-beta.36': + resolution: {integrity: sha512-EfY+ht1TUuEtks+I2P5mxZuyQ7UtkCI1IXAM2gyiAs1CA6jo3Uw9pGDEwlejL1eJerND6AQo16B1fbGlUMQIuA==} + peerDependencies: + react: ~19.1.1 + react-dom: ~19.1.1 '@oclif/core@4.5.2': resolution: {integrity: sha512-eQcKyrEcDYeZJKu4vUWiu0ii/1Gfev6GF4FsLSgNez5/+aQyAUCjg3ZWlurf491WiYZTXCWyKAxyPWk8DKv2MA==} @@ -584,6 +594,9 @@ packages: '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/js-cookie@3.0.6': + resolution: {integrity: sha512-wkw9yd1kEXOPnvEeEV1Go1MmxtBJL0RR79aOTAApecWFVu7w0NNXNqhcWgvw2YgZDYadliXkl14pa3WXw5jlCQ==} + '@types/lodash-es@4.17.12': resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} @@ -601,12 +614,22 @@ packages: '@types/react@19.1.12': resolution: {integrity: sha512-cMoR+FoAf/Jyq6+Df2/Z41jISvGZZ2eTlnsaJRptmZ76Caldwy1odD4xTr/gNV9VLj0AWgg/nmkevIyUfIIq5w==} + '@types/trusted-types@2.0.7': + resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + '@vitejs/plugin-react@5.0.2': resolution: {integrity: sha512-tmyFgixPZCx2+e6VO9TNITWcCQl8+Nl/E8YbAyPVv85QCc7/A3JrdfG2A8gIzvVhWuzMOVrFW1aReaNxrI6tbw==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + ahooks@3.9.5: + resolution: {integrity: sha512-TrjXie49Q8HuHKTa84Fm9A+famMDAG1+7a9S9Gq6RQ0h90Jgqmiq3CkObuRjWT/C4d6nRZCw35Y2k2fmybb5eA==} + engines: {node: '>=18'} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} @@ -673,6 +696,10 @@ packages: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} @@ -703,6 +730,9 @@ packages: resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==} engines: {node: '>=8'} + dompurify@3.3.0: + resolution: {integrity: sha512-r+f6MYR1gGN1eJv0TVQbhA7if/U7P87cdPl3HN5rikqaBSBxLiCb/b9O+2eG0cxz0ghyU+mU1QkbsOwERMYlWQ==} + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -852,6 +882,10 @@ packages: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} + intersection-observer@0.12.2: + resolution: {integrity: sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==} + deprecated: The Intersection Observer polyfill is no longer needed and can safely be removed. Intersection Observer has been Baseline since 2019. + is-docker@2.2.1: resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} engines: {node: '>=8'} @@ -878,6 +912,10 @@ packages: resolution: {integrity: sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==} hasBin: true + js-cookie@3.0.5: + resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==} + engines: {node: '>=14'} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -972,6 +1010,9 @@ packages: lodash-es@4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -1161,6 +1202,9 @@ packages: peerDependencies: react: ^19.1.1 + react-fast-compare@3.2.2: + resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==} + react-icons@5.5.0: resolution: {integrity: sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw==} peerDependencies: @@ -1184,6 +1228,9 @@ packages: resolution: {integrity: sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==} engines: {node: '>=0.10.0'} + resize-observer-polyfill@1.5.1: + resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==} + rollup@4.49.0: resolution: {integrity: sha512-3IVq0cGJ6H7fKXXEdVt+RcYvRCt8beYY9K1760wGQwSAHZcS9eot1zDG5axUbcp/kWRi5zKIIDX8MoKv/TzvZA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -1192,6 +1239,10 @@ packages: scheduler@0.26.0: resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==} + screenfull@5.2.0: + resolution: {integrity: sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA==} + engines: {node: '>=0.10.0'} + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -1204,6 +1255,10 @@ packages: set-cookie-parser@2.7.1: resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} + showdown@2.1.0: + resolution: {integrity: sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==} + hasBin: true + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -1256,10 +1311,34 @@ packages: peerDependencies: browserslist: '>= 4.21.0' + uuid@13.0.0: + resolution: {integrity: sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==} + hasBin: true + validate-npm-package-name@5.0.1: resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + virtua@0.45.3: + resolution: {integrity: sha512-+nW3VOwXhlte3m4jbS9gVMked/cZo95IKChH0qol+XUApQVZpPaLDGee1BC/rVng0tsMfxs0vJPEPEUAAfKpkw==} + peerDependencies: + react: '>=16.14.0' + react-dom: '>=16.14.0' + solid-js: '>=1.0' + svelte: '>=5.0' + vue: '>=3.2' + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + solid-js: + optional: true + svelte: + optional: true + vue: + optional: true + vite@7.1.3: resolution: {integrity: sha512-OOUi5zjkDxYrKhTV3V7iKsoS37VUM7v40+HuwEmcrsf11Cdx9y3DIr2Px6liIcZFwt3XSRpQvFpL3WVy7ApkGw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1348,6 +1427,8 @@ packages: snapshots: + '@adobe/css-tools@4.4.4': {} + '@ampproject/remapping@2.3.0': dependencies: '@jridgewell/gen-mapping': 0.3.13 @@ -1442,6 +1523,8 @@ snapshots: '@babel/core': 7.28.3 '@babel/helper-plugin-utils': 7.27.1 + '@babel/runtime@7.28.4': {} + '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.27.1 @@ -1574,9 +1657,21 @@ snapshots: transitivePeerDependencies: - supports-color - '@mujian/js-sdk@0.0.1': + '@mujian/js-sdk@0.0.6-beta.36(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': dependencies: + '@adobe/css-tools': 4.4.4 + ahooks: 3.9.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + dompurify: 3.3.0 postmate: 1.5.2 + react: 19.1.1 + react-dom: 19.1.1(react@19.1.1) + showdown: 2.1.0 + uuid: 13.0.0 + virtua: 0.45.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + transitivePeerDependencies: + - solid-js + - svelte + - vue '@oclif/core@4.5.2': dependencies: @@ -1775,6 +1870,8 @@ snapshots: '@types/estree@1.0.8': {} + '@types/js-cookie@3.0.6': {} + '@types/lodash-es@4.17.12': dependencies: '@types/lodash': 4.17.20 @@ -1793,6 +1890,9 @@ snapshots: dependencies: csstype: 3.1.3 + '@types/trusted-types@2.0.7': + optional: true + '@vitejs/plugin-react@5.0.2(vite@7.1.3(@types/node@22.18.0)(jiti@2.5.1)(lightningcss@1.30.1))': dependencies: '@babel/core': 7.28.3 @@ -1805,6 +1905,21 @@ snapshots: transitivePeerDependencies: - supports-color + ahooks@3.9.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1): + dependencies: + '@babel/runtime': 7.28.4 + '@types/js-cookie': 3.0.6 + dayjs: 1.11.18 + intersection-observer: 0.12.2 + js-cookie: 3.0.5 + lodash: 4.17.21 + react: 19.1.1 + react-dom: 19.1.1(react@19.1.1) + react-fast-compare: 3.2.2 + resize-observer-polyfill: 1.5.1 + screenfull: 5.2.0 + tslib: 2.8.1 + ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 @@ -1867,6 +1982,8 @@ snapshots: dependencies: delayed-stream: 1.0.0 + commander@9.5.0: {} + convert-source-map@2.0.0: {} cookie@1.0.2: {} @@ -1885,6 +2002,10 @@ snapshots: detect-libc@2.0.4: {} + dompurify@3.3.0: + optionalDependencies: + '@types/trusted-types': 2.0.7 + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 @@ -2032,6 +2153,8 @@ snapshots: indent-string@4.0.0: {} + intersection-observer@0.12.2: {} + is-docker@2.2.1: {} is-fullwidth-code-point@3.0.0: {} @@ -2050,6 +2173,8 @@ snapshots: jiti@2.5.1: {} + js-cookie@3.0.5: {} + js-tokens@4.0.0: {} jsesc@3.1.0: {} @@ -2113,6 +2238,8 @@ snapshots: lodash-es@4.17.21: {} + lodash@4.17.21: {} + lru-cache@10.4.3: {} lru-cache@5.1.1: @@ -2205,6 +2332,8 @@ snapshots: react: 19.1.1 scheduler: 0.26.0 + react-fast-compare@3.2.2: {} + react-icons@5.5.0(react@19.1.1): dependencies: react: 19.1.1 @@ -2221,6 +2350,8 @@ snapshots: react@19.1.1: {} + resize-observer-polyfill@1.5.1: {} + rollup@4.49.0: dependencies: '@types/estree': 1.0.8 @@ -2249,12 +2380,18 @@ snapshots: scheduler@0.26.0: {} + screenfull@5.2.0: {} + semver@6.3.1: {} semver@7.7.2: {} set-cookie-parser@2.7.1: {} + showdown@2.1.0: + dependencies: + commander: 9.5.0 + source-map-js@1.2.1: {} string-width@4.2.3: @@ -2303,8 +2440,15 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + uuid@13.0.0: {} + validate-npm-package-name@5.0.1: {} + virtua@0.45.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1): + optionalDependencies: + react: 19.1.1 + react-dom: 19.1.1(react@19.1.1) + vite@7.1.3(@types/node@22.18.0)(jiti@2.5.1)(lightningcss@1.30.1): dependencies: esbuild: 0.25.9 diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx new file mode 100644 index 0000000..7784b4f --- /dev/null +++ b/src/components/Button/index.tsx @@ -0,0 +1,19 @@ +import React from 'react'; + +interface ButtonProps extends React.ButtonHTMLAttributes { + children: React.ReactNode; +} + +export const Button: React.FC = ({ children, className = '', ...props }) => { + return ( + + ); +}; + + + diff --git a/src/components/index.ts b/src/components/index.ts index 99e3012..7f18f94 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1 +1,2 @@ +export * from './Button'; export * from './Example'; diff --git a/src/main.tsx b/src/main.tsx index 79e526e..6105656 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,7 +1,7 @@ import { createRoot } from 'react-dom/client'; import '@/styles/fonts.css'; import '@/styles/global.css'; -import { MujianProvider } from './providers/MujianProvider.tsx'; +import { MujianProvider } from '@mujian/js-sdk/react'; import { ReactRouterProvider } from './providers/RouterProvider.tsx'; createRoot(document.getElementById('root')!).render( diff --git a/src/pages/about/index.css b/src/pages/about/index.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/pages/about/index.tsx b/src/pages/about/index.tsx index e7ee1f0..76752c0 100644 --- a/src/pages/about/index.tsx +++ b/src/pages/about/index.tsx @@ -1,10 +1,24 @@ +import { Button } from '@/components'; import './index.css'; +import { useNavigate } from 'react-router'; + // import { useGlobalStore } from "@/store/global"; function About() { + const navigate = useNavigate(); // const { count, increment } = useGlobalStore((state) => state); - return
about page
; + return ( +
+
这里是第二个页面
+ +
+ ); } export default About; diff --git a/src/pages/home/index.css b/src/pages/home/index.css index e69de29..c858e40 100644 --- a/src/pages/home/index.css +++ b/src/pages/home/index.css @@ -0,0 +1 @@ +/* 首页样式 */ \ No newline at end of file diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index 3c055ac..b450709 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -1,17 +1,16 @@ -import { useGlobalStore } from '@/store/global'; import './index.css'; -import { isEmpty } from 'lodash-es'; +import { useNavigate } from 'react-router'; import { Button } from '@/components'; function Home() { - + const navigate = useNavigate(); return ( - <> -
-
Hello World2
-
- - +
+
这里是首页
+ +
); } diff --git a/src/styles/global.css b/src/styles/global.css index 5aa6cf6..b36b6ca 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -1,3 +1,5 @@ +/* 全局样式 */ + @import "tailwindcss"; :root {