2 Commits

Author SHA1 Message Date
twosugar 43a386ca92 chore(lint): 引入 oxlint 并清理未使用代码
新增 oxlint@1.80.0 + .oxlintrc.json + lint/lint:fix 脚本;清空所有
no-unused-vars 告警(未用 React/导入/变量/参数),删除无引用的 ui/Skill。
oxlint exit 0。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-28 16:14:18 +08:00
twosugar d83d52b73d feat(migrate): port TryIt (interactive API caller) to React workspace
Sprint 2 §S7. Ports legacy TryIt (9 vue files under
`docs/.vitepress/theme/components/TryIt/` + `theme/utils/{http-client,
websocket-client}.ts`) to React inside a new `packages/tryit` workspace
published as `@longbridge/openapi-tryit`. Uses react-hook-form for
form generation from openapi schema; fires real API requests against
`openapi.longportapp.com`.

Files created:
- packages/tryit/package.json — bun workspace, deps: react-hook-form,
  @longbridge/openapi-utils, @longbridge/openapi-api-reference
- packages/tryit/tsconfig.json
- packages/tryit/src/index.ts — barrel
- packages/tryit/src/TryIt.tsx — orchestrator: button mode → panel mode,
  data-lbus-component="tryit" preserved
- packages/tryit/src/AuthorizationForm.tsx — cookie/localStorage-backed
  appKey / appSecret / accessToken inputs
- packages/tryit/src/ParametersForm.tsx — walks op parameters + request
  body via SchemaRenderer
- packages/tryit/src/PlayButton.tsx — assembles request, dispatches via
  clients
- packages/tryit/src/ResponseView.tsx — pretty-prints JSON response
- packages/tryit/src/tryit.css — form + response viewer styles
- packages/tryit/src/clients/http-client.ts — verbatim port of legacy
- packages/tryit/src/clients/websocket-client.ts — verbatim port of legacy
- packages/tryit/src/utils/app-id.ts — id derivation
- packages/tryit/src/utils/request.ts — request assembly helper
- packages/tryit/src/hooks/useTryItMode.ts — `?mode=try-it` URL toggle
- packages/tryit/src/hooks/useAuthorization.ts — cookie sync
- packages/tryit/src/hooks/useResponse.ts — response state

Modified:
- src/mdx-components.tsx — swap import from placeholder to
  `@longbridge/openapi-tryit`
- root package.json — workspace dep

Deleted:
- src/components/mdx/placeholders/TryIt.tsx

Verified:
- astro check: 0 errors (0 new warnings)
- All 15 canonical URLs return 200
- `<TryIt />` registered in mdx-components; mount site (frontmatter
  `httpInfo` or explicit tag) is handled by later plumbing

Closes Sprint 2 §S7.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-08-19 01:26:53 +08:00