Skip to content

Conversation

@mkahvi
Copy link
Contributor

@mkahvi mkahvi commented Sep 23, 2025

Implements #56

Tested with the following transformer:

transformSerialized: async (content, { filename } = {}) => {
  return prettier.format(content, { ...prettierConfig, filepath: filename });
},

@Fyorl Fyorl merged commit 5273994 into foundryvtt:main Jan 14, 2026
@Fyorl
Copy link
Contributor

Fyorl commented Jan 14, 2026

I have modified this to pass the full filename in the serialization context since it avoids having to pass extra arguments. You can extra the last portion with path.basename if needed.

@mkahvi
Copy link
Contributor Author

mkahvi commented Jan 14, 2026

@Fyorl I think I had it not use that because you couldn't nicely determine the proper path of the file with that. It included a lot of spurious details that were not part of the project's pathing. At least in my testing it had really weird paths compared to what the PR separately used.

@Fyorl
Copy link
Contributor

Fyorl commented Jan 14, 2026

@Fyorl I think I had it not use that because you couldn't nicely determine the proper path of the file with that. It included a lot of spurious details that were not part of the project's pathing. At least in my testing it had really weird paths compared to what the PR separately used.

From just looking at the code, as far as I can tell, in all cases where you passed filename: name or filename: embeddedName, etc. just a few lines up we have filename = path.join(dest, name). So it should always be possible to extract the name in that case because path.basename(path.join(dest, name)) === name.

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