Skip to content

Comments

パッケージ概要のリファクタリング#1042

Merged
irof merged 51 commits intomainfrom
agent/refactor-package-js
Feb 6, 2026
Merged

パッケージ概要のリファクタリング#1042
irof merged 51 commits intomainfrom
agent/refactor-package-js

Conversation

@irof
Copy link
Collaborator

@irof irof commented Feb 6, 2026

No description provided.

irof added 30 commits February 6, 2026 12:26
package.jsにおいて、散在していたモジュールスコープ変数を単一のpackageContextオブジェクトに集約しました。
これにより、以下の改善が期待されます。

- コードの可読性と推論の容易さの向上
- テストの独立性と安定性の向上
- 将来的な変更による副作用のリスク低減

関連するテストファイルも更新し、変更の正当性を検証済みです。
This change refactors the 'collectRelatedSet' function to be a pure function, taking its dependencies as arguments instead of relying on the 'packageContext' object. This improves testability and decouples the logic from the application state.
This change refactors the 'buildAggregationStatsForFilters' and 'buildAggregationStatsForRelated' functions to be pure, taking their dependencies as arguments instead of relying on the 'packageContext' object. This continues the effort to improve testability and decouple logic from application state.
This change extracts the complex data filtering logic from 'renderPackageDiagram' into a new pure function 'getVisibleDiagramElements'. This improves testability by isolating the logic from DOM side effects and makes the rendering function easier to understand.
This change introduces a 'dom' helper object to encapsulate direct DOM access for the 'renderRelatedFilterTarget' function. This makes the DOM dependency explicit and improves testability by allowing easier mocking of DOM interactions.
This change refactors the 'getOrCreateDiagramErrorBox', 'showDiagramErrorMessage', and 'hideDiagramErrorMessage' functions to use a 'dom' helper object. This encapsulates direct DOM access, making the DOM dependency explicit and improving testability by allowing easier mocking of DOM interactions for error display.
This change refactors the 'renderDiagramSvg' function to use a 'dom' helper object. This encapsulates direct DOM access for diagram content manipulation and attribute removal, improving testability by allowing easier mocking of DOM interactions.
This change refactors the 'getPackageSummaryData' function to use 'dom' helper methods ('getPackageDataScript' and 'getNodeTextContent'). This encapsulates direct DOM access for retrieving initial package data, making the DOM dependency explicit and improving testability by allowing easier mocking of DOM interactions.
@irof irof changed the title agent/refactor-package-js パッケージ概要のリファクタリング Feb 6, 2026
@irof irof merged commit c944ac5 into main Feb 6, 2026
2 checks passed
@irof irof deleted the agent/refactor-package-js branch February 6, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant