Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(yaml): Add extensions option to load YAML files with custom extensions #1445

Merged
merged 3 commits into from May 12, 2023
Merged

feat(yaml): Add extensions option to load YAML files with custom extensions #1445

merged 3 commits into from May 12, 2023

Conversation

janosh
Copy link
Contributor

@janosh janosh commented Feb 26, 2023

Rollup Plugin Name: yaml

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no (not yet but happy to add)

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

#868

Description

GH supports citable repos by adding a citation.cff file in YAML format at the root. In scientific contexts, this makes needing to load yaml files with .cff extension a common use case. Would be great if this was supported!

@janosh janosh changed the title Support importing .cff files with yaml plugin feat(yaml): Support importing .cff files Feb 26, 2023
@shellscape
Copy link
Collaborator

Thanks for the PR. Unfortunately we won't be able to accept this PR. We mentioned in #868 that this is a pretty small edge case. It looks like .CFF is a niche format with very little support for the standard (https://citation-file-format.github.io/).

An alternative approach that would make more sense would be to allow the plugin to accept an option to provide additional file extensions which the user believes are YAML-compatible.

@shellscape shellscape closed this Apr 4, 2023
@janosh
Copy link
Contributor Author

janosh commented Apr 4, 2023

It looks like .CFF is a niche format with very little support for the standard (https://citation-file-format.github.io/).

GitHub, Zernodo and Zotero is actually pretty broad support for someone in the scientific community.

An alternative approach that would make more sense would be to allow the plugin to accept an option to provide additional file extensions which the user believes are YAML-compatible.

I agree that would make more sense but in #868 you rejected that proposal and the issue was closed (as completed). If you changed your mind, maybe reopen it?

@shellscape
Copy link
Collaborator

I agree that would make more sense but in #868 you rejected that proposal and the issue was closed (as completed). If you changed your mind, maybe reopen it?

Correction, the stale bot closed it because it didn't get engagement. There's a large difference that's important to understand.

The author of #868 didn't provide specifics or context along the lines of what you provided here. Our job as maintainers is not to accept every request - our job is to say "no," frequently, to keep projects focused and free from bloat (as a counter example, see Webpack). These are two different issues in my view. One is unspecific and one is specific, exposing a wider reasonable need without catering directly to edge cases. I won't reopen #868 because it hasn't met the guidelines that the bot posted, but I will reopen this PR if you're interesting in pivoting to the alternative approach I mentioned.

Worst case, you've got a fork of the yaml plugin that can handle .cff files and could publish it as a community plugin and have it added to https://github.com/rollup/awesome/

@janosh
Copy link
Contributor Author

janosh commented Apr 4, 2023

Sure, I'll take a swing at making extensions configurable!

Re the correction, I noticed the issue was not closed by you. But I (perhaps mis-)read your reply

That's a pretty unique edge case. The yaml plugin is pretty small, I'd recommend forking it for your use case.

as a rejection of configurable extensions (perhaps because I don't see how my issue is more general than #868).

@shellscape shellscape reopened this Apr 4, 2023
@janosh
Copy link
Contributor Author

janosh commented Apr 4, 2023

@shellscape I opted for String.endsWith over regex. Is that ok?

@shellscape
Copy link
Collaborator

Thanks for the ping. I'm very short on time at the moment. I like the new direction. We'll need some tests around the change and the CI failures will need to be resolved.

@janosh
Copy link
Contributor Author

janosh commented May 12, 2023

@shellscape I added 5 tests. Let me know if you think more are needed.

@shellscape shellscape merged commit 59a2dc2 into rollup:master May 12, 2023
7 checks passed
@janosh janosh changed the title feat(yaml): Support importing .cff files feat(yaml): Add extensions option to load YAML files with custom extensions May 13, 2023
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.

None yet

2 participants