Compare commits

...

1 Commits

Author SHA1 Message Date
zhsama
2eca49e099 feat: Add Agentation devtools component for development 2026-01-24 16:28:01 +08:00
5 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
'use client'
import { Agentation as AgentationComponent } from 'agentation'
export const Agentation = () => {
return <AgentationComponent />
}

View File

@@ -0,0 +1,21 @@
'use client'
import { lazy, Suspense } from 'react'
import { IS_DEV } from '@/config'
const Agentation = lazy(() =>
import('./agentation').then(module => ({
default: module.Agentation,
})),
)
export const AgentationLoader = () => {
if (!IS_DEV)
return null
return (
<Suspense fallback={null}>
<Agentation />
</Suspense>
)
}

View File

@@ -10,6 +10,7 @@ import { DatasetAttr } from '@/types/feature'
import { cn } from '@/utils/classnames'
import { ToastProvider } from './components/base/toast'
import BrowserInitializer from './components/browser-initializer'
import { AgentationLoader } from './components/devtools/agentation/loader'
import { ReactScanLoader } from './components/devtools/react-scan/loader'
import { I18nServerProvider } from './components/provider/i18n-server'
import { PWAProvider } from './components/provider/serwist'
@@ -121,6 +122,7 @@ const LocaleLayout = async ({
</ThemeProvider>
</JotaiProvider>
<RoutePrefixHandle />
<AgentationLoader />
</PWAProvider>
</body>
</html>

View File

@@ -204,6 +204,7 @@
"@typescript/native-preview": "7.0.0-dev.20251209.1",
"@vitejs/plugin-react": "5.1.2",
"@vitest/coverage-v8": "4.0.17",
"agentation": "1.3.2",
"autoprefixer": "10.4.21",
"code-inspector-plugin": "1.3.6",
"cross-env": "10.1.0",

14
web/pnpm-lock.yaml generated
View File

@@ -499,6 +499,9 @@ importers:
'@vitest/coverage-v8':
specifier: 4.0.17
version: 4.0.17(vitest@4.0.17(@types/node@18.15.0)(happy-dom@20.0.11)(jiti@1.21.7)(jsdom@27.3.0(canvas@3.2.0))(sass@1.93.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))
agentation:
specifier: 1.3.2
version: 1.3.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
autoprefixer:
specifier: 10.4.21
version: 10.4.21(postcss@8.5.6)
@@ -4073,6 +4076,12 @@ packages:
resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==}
engines: {node: '>= 14'}
agentation@1.3.2:
resolution: {integrity: sha512-9yZ/3hTcNePr1asnMyipxAZU8nFdBibNfw7wTdLUd3ULTTQCp9QZX7Y5PTMzkYWX4fhqEI2LOjMCb3vkmZga9w==}
peerDependencies:
react: '>=18.0.0'
react-dom: '>=18.0.0'
ahooks@3.9.5:
resolution: {integrity: sha512-TrjXie49Q8HuHKTa84Fm9A+famMDAG1+7a9S9Gq6RQ0h90Jgqmiq3CkObuRjWT/C4d6nRZCw35Y2k2fmybb5eA==}
engines: {node: '>=18'}
@@ -12635,6 +12644,11 @@ snapshots:
agent-base@7.1.4: {}
agentation@1.3.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3):
dependencies:
react: 19.2.3
react-dom: 19.2.3(react@19.2.3)
ahooks@3.9.5(react-dom@19.2.3(react@19.2.3))(react@19.2.3):
dependencies:
'@babel/runtime': 7.28.4