Skip to content

feat: add filename case support - #388

Closed
jruhland wants to merge 2 commits into
eddeee888:masterfrom
jruhland:feat/add-filename-case-support
Closed

feat: add filename case support#388
jruhland wants to merge 2 commits into
eddeee888:masterfrom
jruhland:feat/add-filename-case-support

Conversation

@jruhland

Copy link
Copy Markdown

Not 100% sure of the standards on the repository, so just going to throw this up as this has been an area of friction for our team using the plugin.

We want to allows users to control the naming convention of generated resolver files,
supporting common filename formats, while preserving original default functionality. Separate of the contents inside the file.

Details:

  • Add change-case-all dependency to typescript-resolver-files package
  • Add fileOutputCasing config option with 'pascal-case' (default) and other casing support
  • Update preset config validation to include fileOutputCasing option
  • Add transformResolverFileName utility to convert resolver names to appropriate filename casing
  • Integrate filename transformation throughout the resolver generation pipeline
  • Add unit test coverage for filename transformation functionality
  • Add e2e test suite
  • Update documentation in README.md

@changeset-bot

changeset-bot Bot commented Aug 12, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0b940c8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This allows users to control the naming convention of generated resolver files,
supporting common filename formats, while preserving original default functionality.

Details:

- Add change-case-all dependency to typescript-resolver-files package
- Add fileOutputCasing config option with 'pascal-case' (default) and other casing support
- Update preset config validation to include fileOutputCasing option
- Add transformResolverFileName utility to convert resolver names to appropriate filename casing
- Integrate filename transformation throughout the resolver generation pipeline
- Add unit test coverage for filename transformation functionality
- Add e2e test suite
- Update documentation in README.md
@jruhland
jruhland force-pushed the feat/add-filename-case-support branch from 407291a to 65cc142 Compare August 12, 2025 21:27
@jruhland jruhland changed the title feat/add filename case support feat: add filename case support Aug 12, 2025
@eddeee888

Copy link
Copy Markdown
Owner

Thank you! I'll take a look soon 👀

@jruhland

Copy link
Copy Markdown
Author

No hurry/pressure, but let me know if theres anything I can do to help out here.

@eddeee888

eddeee888 commented Sep 21, 2025

Copy link
Copy Markdown
Owner

Hi @jruhland,

I'm trying to think whether allowing filename case changes would open possibilities of naming clashes (the thought came from some of the unit tests - thank you!)

For example, if the option is snake case, would these two types have a file name clash in our file system?

type UserName
type user_name

Granted, it's unlikely codebases would allow a mix of conventions like this (but we never know 😅).
However, the current approach of using the exact type name as file name definitely avoids this potential issue.

@jruhland

Copy link
Copy Markdown
Author

Hi @jruhland,

I'm trying to think whether allowing filename case changes would open possibilities of naming clashes (the thought came from some of the unit tests - thank you!)

For example, if the option is snake case, would these two types have a file name clash in our file system?

type UserName
type user_name

Granted, it's unlikely codebases would allow a mix of conventions like this (but we never know 😅). However, the current approach of using the exact type name as file name definitely avoids this potential issue.

Wow sorry missed this comment, and yeah good call out. Let me verify that, but yeah I think it would cause a collision (ive never seen snake case in graphql, but yeah im sure theres some funky codebase out there). WDYT about erroring out due to collision (only if this flag is enabled)?

@jruhland jruhland closed this Dec 9, 2025
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.

2 participants