fix(danmaku): browser-safe entry, yarn test wiring, AGENTS map
This commit is contained in:
parent
b90d7dfc55
commit
5b095d677f
|
|
@ -13,6 +13,7 @@
|
|||
| 包 | 职责 | 依赖 |
|
||||
|----|------|------|
|
||||
| `@app/types` | Zod 入参 schema + 共享输出类型 | zod |
|
||||
| `@app/danmaku` | 弹幕开放协议纯函数(签名/hash/XML/匹配/过滤;`./browser` 无 node:crypto) | — |
|
||||
| `@app/models` | Drizzle 表定义(唯一 schema 源) | drizzle-orm |
|
||||
| `@app/db` | libSQL/Turso 客户端单例 + drizzle-kit | models |
|
||||
| `@app/dao` | 数据访问层(`userDao` / `mountDao` / `mediaItemDao` 等) | db, models |
|
||||
|
|
@ -29,8 +30,10 @@
|
|||
|
||||
```
|
||||
web ──► trpc ──► dao ──► db ──► models
|
||||
│ │ │
|
||||
│ │ │ │
|
||||
│ │ └──► danmaku │
|
||||
│ └─────────────────┴──► types
|
||||
├──► danmaku(浏览器侧走 ./browser)
|
||||
├──► design-tokens
|
||||
├──► seo-geo
|
||||
├──► i18n
|
||||
|
|
@ -55,6 +58,7 @@ docs(独立,不依赖上述业务包)
|
|||
|
||||
```bash
|
||||
yarn install
|
||||
yarn test # 各包 vitest(turbo run test)
|
||||
yarn typecheck # 全仓 typecheck
|
||||
yarn lint # Biome
|
||||
yarn build # 全仓 build(依赖拓扑)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
serializeDanmakuXml,
|
||||
type DanmakuComment,
|
||||
type FilterOptions,
|
||||
} from "@app/danmaku";
|
||||
} from "@app/danmaku/browser";
|
||||
|
||||
export { filterComments, parseDanmakuXml, serializeDanmakuXml };
|
||||
export type { DanmakuComment, FilterOptions };
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
"docs:dev": "yarn workspace @app/docs dev",
|
||||
"docs:build": "yarn workspace @app/docs build",
|
||||
"typecheck": "turbo run typecheck",
|
||||
"test": "turbo run test",
|
||||
"test:e2e": "playwright test",
|
||||
"lint": "turbo run lint",
|
||||
"clean": "turbo run clean",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@
|
|||
".": {
|
||||
"import": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"./browser": {
|
||||
"import": "./dist/browser.js",
|
||||
"types": "./dist/browser.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
/** 浏览器安全入口:不含 node:crypto(hash/signature)与 fetch 客户端(client)。 */
|
||||
export { openCommentsToXml, parseDanmakuXml, serializeDanmakuXml } from "./xml.js";
|
||||
export { filterComments, modeToKind } from "./filter.js";
|
||||
export type { FilterOptions } from "./filter.js";
|
||||
export { parseMatchOutcome, rankCandidates } from "./match.js";
|
||||
export type { OpenMatchOutcome } from "./match.js";
|
||||
export type { DanmakuComment, MatchCandidate } from "./types.js";
|
||||
|
|
@ -27,6 +27,10 @@
|
|||
"lint": {
|
||||
"outputs": []
|
||||
},
|
||||
"test": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": []
|
||||
},
|
||||
"db:generate": {
|
||||
"cache": false,
|
||||
"dependsOn": ["^build"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue