Implement module registry for better seperation
維護者通常 3 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- eslint, typescript
研究方向
Start by reading the module setup in src/lib/modules/types.ts and src/lib/modules/index.ts, then trace the existing navigation and request handling through nav-items.ts, +layout.svelte, NavigationProgress, +layout.server.ts, and hooks.server.ts. Check how storage and Trino configuration and handleStorageConnection are currently loaded. Done means enabled modules alone initialize and handle their routes, disabled module routes return 404, and the specified unit and E2E cases pass.
由索引模型根據 Issue 內容生成。
描述
Goal: Every module can be switched on and off independently with a feature flag
- Module contract. Add src/lib/modules/types.ts defining a CockpitModule: id, routePrefix, enabled, navigation entry, page title, optional init() and optional server handle. The registry lives in src/lib/modules/index.ts and is a static list.
- Move storage and Trino onto it.
- The sidebar (nav-items.ts), page titles (+layout.svelte), NavigationProgress and +layout.server.ts all read from the registry.
- hooks.server.ts returns 404 for routes of disabled modules and only runs a module's handle on its own routes. handleStorageConnection moves into the storage module.
- init runs init() only for enabled modules.
- Validate config only for enabled modules. The storage and Trino configs are no longer imported unconditionally. They're parsed in their module's init(), so an invalid variable stops the server only when that module is enabled.
- New STACKABLE_COCKPIT_TRINO_ENABLED flag
- Boundaries. An ESLint rule (import/no-restricted-paths) stops modules importing each other.
Tests
- Unit tests for the registry and hook logic.
- E2E: with a module disabled, pages and API return 404, it's missing from the sidebar, and the server starts even with invalid config for it. With it enabled, the existing flows still work.
Result: a new module becomes one module.ts entry plus its own folders. The central files only change for shared concerns.
- 主要語言
- TypeScript
- 星號
- 1
- 分支
- 0
- 平均合併
- 3 天 12 小時
- 30 天內合併 PR
- 31
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
stackabletech/cockpit 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
stackabletech/cockpit#385 ·
維護者通常 3 天內回覆
-
難度 5/5 一週以上 新手友好度 15/100
stackabletech/cockpit#441 ·
維護者通常 3 天內回覆
-
難度 5/5 一週以上 新手友好度 20/100
stackabletech/cockpit#439 ·
維護者通常 3 天內回覆
-
難度 3/5 1-2 天 新手友好度 42/100
stackabletech/cockpit#428 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 45/100
stackabletech/cockpit#427 ·
維護者通常 3 天內回覆
查看 stackabletech/cockpit 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
WalletConnect/walletconnect-monorepo#7392 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
-
fehler
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
Azure/azure-functions-nodejs-extensions#180 ·
維護者通常 1 天內回覆
-
bug good first issue help wanted
難度 2/5 1-3 小時 新手友好度 88/100
laaielichter/Threesmith#28 ·
維護者通常 1 天內回覆