feat(adapter-wp): 包骨架与限额契约
Plan 2 Task 1:@sf/adapter-wp 包骨架(照 contracts 先例:build extends + rootDir "." + exclude test)+ WxrLimits 十字段限额契约与 DEFAULT_WXR_LIMITS 值域冻结(设计基线 §7.2)+ 跨包接线。 跨包接线(一份 paths 三方消费): - 根 tsconfig compilerOptions.paths 把 @sf/contracts、@sf/adapter-wp 映射到 各自 src/index.ts;adapter tsconfig extends 根 tsconfig 使包级 tsc 读同一 份 paths(extends 相对路径按声明处解析,映射始终落在仓库根) - 根 vitest.config.ts resolve.alias 指向同一映射(vitest 不读 tsconfig paths) - adapter 加 @sf/contracts workspace:* 依赖;三方均直连 src,不经 dist (已实测:移走 contracts dist 后 vitest 与包级 tsc 仍全绿) - 根 devDependencies 加 @types/node@^22(对齐 apps/api 钉 22):alias 的 fileURLToPath 辅助需 node 类型,此前根程序靠 apps/api 传递 @types 才有 node 全局,属偶合 限额类型锁(照 contracts 单源派生先例):DEFAULT_WXR_LIMITS as const satisfies WxrLimits + _LIMIT_KEYS 键集与 keyof WxrLimits 双向咬合断言; timeBudgetMs 以可注入时钟(构造函数 now())测试于 Task 3、实测覆盖于 Task 8。 验证:pnpm test 78 绿(75+3);pnpm --filter @sf/adapter-wp exec tsc -p tsconfig.json --noEmit exit 0(--listFiles 证实 contracts 经 src 解析); 根 typecheck 链与 pnpm lint 绿;build 产物形状核验后清理。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Generated
+21
-26
@@ -11,6 +11,9 @@ importers:
|
||||
'@eslint/js':
|
||||
specifier: ^9.39.0
|
||||
version: 9.39.5
|
||||
'@types/node':
|
||||
specifier: ^22
|
||||
version: 22.20.5
|
||||
eslint:
|
||||
specifier: ^9.39.0
|
||||
version: 9.39.5
|
||||
@@ -22,7 +25,7 @@ importers:
|
||||
version: 8.72.0(eslint@9.39.5)(typescript@5.9.3)
|
||||
vitest:
|
||||
specifier: ^2.1.0
|
||||
version: 2.1.9(@types/node@26.6.5)
|
||||
version: 2.1.9(@types/node@22.20.5)
|
||||
|
||||
apps/api:
|
||||
dependencies:
|
||||
@@ -58,6 +61,12 @@ importers:
|
||||
specifier: ^5.6.0
|
||||
version: 5.9.3
|
||||
|
||||
packages/adapter-wordpress:
|
||||
dependencies:
|
||||
'@sf/contracts':
|
||||
specifier: workspace:*
|
||||
version: link:../contracts
|
||||
|
||||
packages/contracts: {}
|
||||
|
||||
packages:
|
||||
@@ -905,9 +914,6 @@ packages:
|
||||
'@types/node@22.20.5':
|
||||
resolution: {integrity: sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==}
|
||||
|
||||
'@types/node@26.6.5':
|
||||
resolution: {integrity: sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.72.0':
|
||||
resolution: {integrity: sha512-aysKgysPX9XOv/dk95UkvUDe++Q3n3dJPG9CEWT3RUccxfkPJ+Qn6nhKPDhZXU6Ofo9kgwGWwKyQCnZIXTgngg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@@ -1622,9 +1628,6 @@ packages:
|
||||
undici-types@6.21.0:
|
||||
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
||||
|
||||
undici-types@8.9.0:
|
||||
resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==}
|
||||
|
||||
uri-js@4.4.1:
|
||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||
|
||||
@@ -2215,11 +2218,6 @@ snapshots:
|
||||
dependencies:
|
||||
undici-types: 6.21.0
|
||||
|
||||
'@types/node@26.6.5':
|
||||
dependencies:
|
||||
undici-types: 8.9.0
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5)(typescript@5.9.3))(eslint@9.39.5)(typescript@5.9.3)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.2
|
||||
@@ -2318,13 +2316,13 @@ snapshots:
|
||||
chai: 5.3.3
|
||||
tinyrainbow: 1.2.0
|
||||
|
||||
'@vitest/mocker@2.1.9(vite@5.4.21(@types/node@26.6.5))':
|
||||
'@vitest/mocker@2.1.9(vite@5.4.21(@types/node@22.20.5))':
|
||||
dependencies:
|
||||
'@vitest/spy': 2.1.9
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.21
|
||||
optionalDependencies:
|
||||
vite: 5.4.21(@types/node@26.6.5)
|
||||
vite: 5.4.21(@types/node@22.20.5)
|
||||
|
||||
'@vitest/pretty-format@2.1.9':
|
||||
dependencies:
|
||||
@@ -2938,20 +2936,17 @@ snapshots:
|
||||
|
||||
undici-types@6.21.0: {}
|
||||
|
||||
undici-types@8.9.0:
|
||||
optional: true
|
||||
|
||||
uri-js@4.4.1:
|
||||
dependencies:
|
||||
punycode: 2.3.1
|
||||
|
||||
vite-node@2.1.9(@types/node@26.6.5):
|
||||
vite-node@2.1.9(@types/node@22.20.5):
|
||||
dependencies:
|
||||
cac: 6.7.14
|
||||
debug: 4.4.3
|
||||
es-module-lexer: 1.7.0
|
||||
pathe: 1.1.2
|
||||
vite: 5.4.21(@types/node@26.6.5)
|
||||
vite: 5.4.21(@types/node@22.20.5)
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- less
|
||||
@@ -2963,19 +2958,19 @@ snapshots:
|
||||
- supports-color
|
||||
- terser
|
||||
|
||||
vite@5.4.21(@types/node@26.6.5):
|
||||
vite@5.4.21(@types/node@22.20.5):
|
||||
dependencies:
|
||||
esbuild: 0.21.5
|
||||
postcss: 8.5.31
|
||||
rollup: 4.64.12
|
||||
optionalDependencies:
|
||||
'@types/node': 26.6.5
|
||||
'@types/node': 22.20.5
|
||||
fsevents: 2.3.3
|
||||
|
||||
vitest@2.1.9(@types/node@26.6.5):
|
||||
vitest@2.1.9(@types/node@22.20.5):
|
||||
dependencies:
|
||||
'@vitest/expect': 2.1.9
|
||||
'@vitest/mocker': 2.1.9(vite@5.4.21(@types/node@26.6.5))
|
||||
'@vitest/mocker': 2.1.9(vite@5.4.21(@types/node@22.20.5))
|
||||
'@vitest/pretty-format': 2.1.9
|
||||
'@vitest/runner': 2.1.9
|
||||
'@vitest/snapshot': 2.1.9
|
||||
@@ -2991,11 +2986,11 @@ snapshots:
|
||||
tinyexec: 0.3.2
|
||||
tinypool: 1.1.1
|
||||
tinyrainbow: 1.2.0
|
||||
vite: 5.4.21(@types/node@26.6.5)
|
||||
vite-node: 2.1.9(@types/node@26.6.5)
|
||||
vite: 5.4.21(@types/node@22.20.5)
|
||||
vite-node: 2.1.9(@types/node@22.20.5)
|
||||
why-is-node-running: 2.3.0
|
||||
optionalDependencies:
|
||||
'@types/node': 26.6.5
|
||||
'@types/node': 22.20.5
|
||||
transitivePeerDependencies:
|
||||
- less
|
||||
- lightningcss
|
||||
|
||||
Reference in New Issue
Block a user