Skip to content

feat: add "Generated with OpenCite version" comment to CITATION.cff - #89

Open
beanbean9339 wants to merge 3 commits into
mainfrom
feat/issue-85-generated-with-comment
Open

beanbean9339 wants to merge 3 commits into
mainfrom
feat/issue-85-generated-with-comment

Conversation

@beanbean9339

Copy link
Copy Markdown
Collaborator

Closes #85

Summary

Generated CITATION.cff files now start with a YAML comment noting the OpenCite version:

# Generated with OpenCite version 1.0.0
  • The version is read from package.json via src/appVersion.js, so it stays in sync on release.
  • .zenodo.json is unchanged because JSON does not support comments.
  • README documents the new header.

Testing

  • tests/services/appVersion.test.js: the first line of the generated file is the comment, and APP_VERSION matches package.json.
  • node --test (107 passed) and npm run build on Node 22.

Notes

src/appVersion.js uses import ... with { type: 'json' }, which needs Node 20 or newer. CI uses Node 24.

beanbean9339 and others added 2 commits November 8, 2026 16:12
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@beanbean9339 beanbean9339 added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 8, 2026
@beanbean9339
beanbean9339 requested a balanced review from Copilot November 8, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the versioned OpenCite attribution header change.

No open issues 🎉

What changed in this PR

Adds a versioned OpenCite attribution comment to generated CITATION.cff files, addressing #85 while leaving .zenodo.json unchanged.

Changes:

  • Reads the OpenCite version from package.json and prepends it as a YAML comment.
  • Adds tests verifying version synchronization and the generated file’s first line.
  • Documents the header in the README.
File Description
tests/​services/​appVersion.test.js Tests version synchronization and the citation header.
src/​services/​citation.js Prepends the versioned generation comment.
src/​appVersion.js Exports the application version from package.json.
README.md Documents the header and unchanged Zenodo output.

Review effort: Balanced

@egrace479 egrace479 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great!
Just one fix needed for discoverability and to fix the test.
Also, should the version load be in services too?

Comment thread src/services/citation.js Resolved
Comment thread tests/services/appVersion.test.js Resolved
@egrace479

Copy link
Copy Markdown
Member

Let's hold on merging this until we pin the pages deployment to a release so that it will be accurate to the version used.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add commented "Generated with OpenCite version <number>" to citation file

3 participants