mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-07 15:12:18 +08:00
Three core barrels, three diagnoses under naming-conventions §6.4:
- paths: remove the barrel — it only re-exported types while the real entry
is application.getPath(). constants.ts and pathRegistry.ts are independent
building blocks deep-imported by their specific consumers (rules 2/3/4).
- lifecycle: keep the barrel (a cohesive framework consumed as a set by 80+
services), route the last deep-import leaks through it, and prune 13
framework-internal machinery exports (resolver, decorator getters, capability
guards) that no consumer touches — tightening the door to its public surface.
- application: remove the barrel and repoint @application directly at
Application.ts. The barrel bundled the hot `application` locator (~218
consumers) with the bootstrap-only serviceRegistry, so every @application
import dragged in the whole service graph — the root of the JobManager-to-
serviceRegistry eval-time cycle. The locator now loads on its own.
Relocate SHUTDOWN_TIMEOUT_MS from an Application static into
lifecycle/constants.ts: a shared shutdown-grace policy honored by both
Application and JobManager, so JobManager no longer imports the Application
class at all.
Docs (paths/README, application/README, application-overview) and per-file
test mocks (vi.mock('@main/core/application') to '@application';
Application.getPath vi.unmock) are updated in lockstep.
48 lines
1.9 KiB
JSON
48 lines
1.9 KiB
JSON
{
|
|
"compilerOptions": {
|
|
"composite": true,
|
|
"emitDecoratorMetadata": true,
|
|
"experimentalDecorators": true,
|
|
"incremental": true,
|
|
"moduleResolution": "bundler",
|
|
"paths": {
|
|
"@application": ["./src/main/core/application/Application"],
|
|
"@cherrystudio/provider-registry": ["./packages/provider-registry/src/index.ts"],
|
|
"@cherrystudio/provider-registry/node": ["./packages/provider-registry/src/registry-loader.ts"],
|
|
"@data/*": ["./src/main/data/*"],
|
|
"@logger": ["./src/main/core/logger/LoggerService"],
|
|
"@main/*": ["./src/main/*"],
|
|
"@mcp-trace/*": ["./packages/mcp-trace/*"],
|
|
"@modelcontextprotocol/sdk/*": ["./node_modules/@modelcontextprotocol/sdk/dist/esm/*"],
|
|
"@shared/*": ["./src/shared/*"],
|
|
"@cherrystudio/ai-core": ["./packages/aiCore/src"],
|
|
"@cherrystudio/ai-core/*": ["./packages/aiCore/src/*"],
|
|
"@cherrystudio/ai-core/provider": ["./packages/aiCore/src/core/providers"],
|
|
"@cherrystudio/ai-core/built-in/plugins": ["./packages/aiCore/src/core/plugins/built-in"],
|
|
"@cherrystudio/ai-sdk-provider": ["./packages/ai-sdk-provider/src"],
|
|
"@cherrystudio/ai-sdk-provider/*": ["./packages/ai-sdk-provider/src/*"],
|
|
"@test-helpers/*": ["./tests/helpers/*"],
|
|
"@test-mocks/*": ["./tests/__mocks__/*"]
|
|
},
|
|
"tsBuildInfoFile": ".tsbuildinfo/tsconfig.node.tsbuildinfo",
|
|
"types": ["electron-vite/node", "vitest/globals"],
|
|
"useDefineForClassFields": true
|
|
},
|
|
"extends": "@electron-toolkit/tsconfig/tsconfig.node.json",
|
|
"include": [
|
|
"electron.vite.config.*",
|
|
"scripts",
|
|
"src/main/**/*",
|
|
"src/main/env.d.ts",
|
|
"src/preload/**/*",
|
|
"packages/mcp-trace/**/*",
|
|
"packages/provider-registry/**/*",
|
|
"packages/aiCore/src/**/*",
|
|
"packages/ai-sdk-provider/src/**/*",
|
|
"src/shared/**/*",
|
|
"tests/__mocks__/**/*",
|
|
"tests/helpers/**/*"
|
|
],
|
|
"exclude": ["packages/aiCore/src/**/__tests__", "packages/aiCore/test_utils"]
|
|
}
|