Skip to content

Conversation

@tbouffard
Copy link
Member

@tbouffard tbouffard commented Dec 23, 2025

Standardize folder naming convention:

  • codecs → codec
  • mixins → mixin
  • plugins → plugin
  • undoable_changes → undoable-change

Summary by CodeRabbit

  • Refactor
    • Internal module and export locations reorganized for consistency; no changes to public APIs or runtime behavior visible to users.
  • Documentation
    • Added guidance on source folder naming (singular, kebab-case) to developer docs.
  • Note
    • User-facing features and functionality remain unchanged.

✏️ Tip: You can customize this high-level summary in your review settings.

Standardize folder naming convention:
  - codecs → codec
  - mixins → mixin
  - plugins → plugin
  - undoable_changes → undoable-change
@tbouffard tbouffard added the refactor Code refactoring label Dec 23, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

Walkthrough

Renames and re-targets many module import/export paths in packages/core: plural folders changed to singular (e.g., undoable_changesundoable-change, pluginsplugin, codecscodec, mixinsmixin), updating imports/exports and tests to the new paths.

Changes

Cohort / File(s) Change Summary
Serialization codec & tests
packages/core/__tests__/serialization/codec/mxgraph/utils.test.ts, packages/core/src/serialization/register-model-codecs.ts, packages/core/src/serialization/register-other-codecs.ts, packages/core/src/serialization/codec/ChildChangeCodec.ts, packages/core/src/serialization/codec/RootChangeCodec.ts, packages/core/src/serialization/codec/TerminalChangeCodec.ts
Import paths changed from ./codecs/..../codec/... and undoable change imports from ../undoable_changes/...../undoable-change/...; test import updated to match new codec path.
Undoable-change modules
packages/core/src/view/GraphDataModel.ts, packages/core/src/view/GraphSelectionModel.ts, packages/core/src/view/GraphView.ts, packages/core/src/view/animate/Effects.ts, packages/core/src/view/layout/LayoutManager.ts, packages/core/src/view/mixin/SelectionMixin.ts, packages/core/src/serialization/register-other-codecs.ts
All references to undoable-change classes and UndoableEdit moved from ./undoable_changes/..../undoable-change/....
Plugin / handler relocations
packages/core/src/editor/Editor.ts, packages/core/src/view/handler/EdgeHandler.ts, packages/core/src/view/handler/KeyHandler.ts, packages/core/src/view/handler/VertexHandler.ts, packages/core/src/view/cell/CellRenderer.ts, packages/core/src/view/mixin/ConnectionsMixin.ts, packages/core/src/view/mixin/EditingMixin.ts, packages/core/src/view/mixin/EventsMixin.ts, packages/core/src/view/mixin/PanningMixin.ts, packages/core/src/view/other/DragSource.ts
Handler and plugin type/import paths changed from ./plugins/..../plugin/... (e.g., SelectionHandler, CellEditorHandler, ConnectionHandler, PanningHandler, etc.).
Graph core imports
packages/core/src/view/AbstractGraph.ts, packages/core/src/view/Graph.ts, packages/core/src/view/other/Outline.ts
Default plugin import path updated from ./plugins/index.js./plugin/index.js; mixinsmixin path corrections applied where present.
Public API re-exports
packages/core/src/index.ts
Public exports updated to re-export from new singular paths (undoable-change, plugin, codec, mixin); exported symbol names unchanged.
Misc docs
CLAUDE.md
Added “Source Folder Naming” guidance; documentation-only changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lists the folder renaming changes but lacks required template sections like issue reference, checklist items, and detailed explanation of the problem being solved. Add issue reference (closes/fixes #), address PR checklist items, and provide detailed explanation of why this standardization is beneficial and what problem it solves.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: standardizing folder names to singular and kebab-case across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/source_folders_name_kebab-case_only

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d076d35 and 334aa55.

📒 Files selected for processing (1)
  • CLAUDE.md
✅ Files skipped from review due to trivial changes (1)
  • CLAUDE.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Document the naming rules for source folders in packages/core/src/:
- Use singular form (handler/, not handlers/)
- Use kebab-case (my-feature/, not myFeature/)
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64dd088 and d076d35.

📒 Files selected for processing (1)
  • CLAUDE.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx,json,md}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Format code using Prettier with tab width 2, trailing comma ES5, print width 90, and end of line auto.

Files:

  • CLAUDE.md
🧠 Learnings (5)
📓 Common learnings
Learnt from: tbouffard
Repo: maxGraph/maxGraph PR: 857
File: packages/core/src/view/plugins/SelectionHandler.ts:1081-1092
Timestamp: 2025-06-26T13:27:19.012Z
Learning: User tbouffard prefers to keep PRs focused on their main objective and defer implementation improvements or logic fixes to future dedicated PRs. For maxGraph, refactoring PRs like Dictionary→Map migration should not include unrelated logic improvements even when valid issues are identified in the migrated code.
Learnt from: tbouffard
Repo: maxGraph/maxGraph PR: 776
File: packages/core/src/view/AbstractGraph.ts:492-495
Timestamp: 2025-04-24T12:34:56.726Z
Learning: PR #776 focuses on refactoring to introduce AbstractGraph as a base class and moving code from Graph to AbstractGraph. Type improvements and other refinements should be addressed in future PRs to keep this one focused on the core architectural change.
Learnt from: CR
Repo: maxGraph/maxGraph PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-10T13:43:28.685Z
Learning: Applies to packages/core/package.json : Configure imports and exports to use ES2020 module format, with conditional exports supporting both ESM and CommonJS through proper package.json exports field.
Learnt from: CR
Repo: maxGraph/maxGraph PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T16:45:26.610Z
Learning: Applies to packages/core/__tests__/**/*.ts : Import paths in tests should omit the `.js` extension (handled by moduleNameMapper)
Learnt from: tbouffard
Repo: maxGraph/maxGraph PR: 849
File: packages/html/stories/DragSource.stories.js:98-101
Timestamp: 2025-06-13T07:48:10.300Z
Learning: User tbouffard prefers answers in English; avoid switching to other languages in future replies.
📚 Learning: 2025-12-19T16:45:26.610Z
Learnt from: CR
Repo: maxGraph/maxGraph PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T16:45:26.610Z
Learning: Applies to packages/core/src/**/*.ts : Use functions from `internal/i18n-utils.js` (translate, isI18nEnabled) instead of accessing `GlobalConfig.i18n` directly

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-12-19T16:45:26.610Z
Learnt from: CR
Repo: maxGraph/maxGraph PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T16:45:26.610Z
Learning: Applies to packages/core/__tests__/**/*.ts : Tests should be located in `packages/core/__tests__/` mirroring the structure of `src/` directory

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-12-19T16:45:26.610Z
Learnt from: CR
Repo: maxGraph/maxGraph PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T16:45:26.610Z
Learning: Applies to packages/core/src/**/*.ts : Shapes must be registered via registries (e.g., `ShapeRegistry`) before use; `Graph` class auto-registers default shapes, but `BaseGraph` requires manual registration

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-12-10T13:43:28.685Z
Learnt from: CR
Repo: maxGraph/maxGraph PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-10T13:43:28.685Z
Learning: Applies to packages/core/__tests__/**/*.test.ts : Test files must follow the naming pattern `**/*.test.ts` and be located in `packages/core/__tests__/` directory.

Applied to files:

  • CLAUDE.md
🪛 markdownlint-cli2 (0.18.1)
CLAUDE.md

299-299: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
CLAUDE.md (1)

293-309: Source folder naming guidelines are clear and well-documented.

The new section effectively documents the naming convention (singular form, kebab-case) with concrete good/bad examples. The placement and tone align well with the rest of CLAUDE.md and match the PR objectives for standardizing folder names.

@sonarqubecloud
Copy link

@tbouffard tbouffard merged commit 2fee9aa into main Dec 23, 2025
6 checks passed
@tbouffard tbouffard deleted the refactor/source_folders_name_kebab-case_only branch December 23, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant