Skip to content

Conversation

@lp0ql
Copy link

@lp0ql lp0ql commented Jun 28, 2025

Original (日本語)

変更の種類 (Types of changes)

変更内容 (Changes)

追加の背景・補足 (Additional context)

問題を解決しつつ、無理のない範囲で既存の出力と同じになるように心がけています。
(出力の並び順など)

背景

既存実装ではルートグループのマージが困難だったため、クラス化しました。
クラス内で objectKey を管理し、同一レベルに同じキーが重複出力される問題を解消しました。

副作用

  • 生成される型定義の末尾の , の有無が一部変わります。
-    }),
+    })

, が必須の箇所では正しく出力されていることを確認したため、追加修正は行っていません。

知識

parseAppDir.ts 以外のファイルについてあまり理解できていません。🙇‍♂️

テストのパス状況

  • テストは,の差分を除きパスしています。

コミュニティノート (Community note)

賛同される方は 👍 リアクションで Upvote をお願いします。


Types of changes

Changes

Additional context

The fix keeps the generated output identical to the previous version wherever reasonably possible—for example, it preserves the original ordering of entries in the output.

Background

Because the previous implementation made it difficult to merge route groups, the logic was converted to a class-based design.
objectKey is now managed inside the class to eliminate duplicate keys at the same level.

Side effects

  • The presence or absence of a trailing comma , in some generated type definitions has changed.
-    }),
+    })

Commas are still emitted where required, so no further adjustments have been made.

Known limitations

I am not very familiar with files other than parseAppDir.ts in pathpida. 🙇‍♂️

Test status

  • All tests pass except for the comma-related differences.

Community note

Please upvote with reacting as 👍 to express your agreement.

lp0ql added 3 commits June 28, 2025 19:10
クラスベースの実装にリファクタし、同時にissue-197が解消しました。
テストパターンの追加と期待値の修正を行いました。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate object keys in $path.ts when same directory names exist under different Next.js Route Groups

1 participant