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 小时 新手友好度 82/100
prime-radiant-inc/evener#5901 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
Bug: Batcher binds the texture that opens a new batch twice (one draw call per element with maxBatchableTextures = 1)可能已有人在做 @darzarzycki 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 2 天内回复
-
area:study-data p2-high ready-for-agent type:chore
难度 2/5 1-3 小时 新手友好度 78/100
fderuiter/deruiter.dev#3706 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
nicobailon/pi-subagents#3242 ·
维护者通常 1 天内回复