cff-initializer-javascript
Web form to initialize CITATION.cff files.
https://github.com/citation-file-format/cff-initializer-javascript
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.6%) to scientific vocabulary
Repository
Web form to initialize CITATION.cff files.
Basic Info
- Host: GitHub
- Owner: citation-file-format
- License: apache-2.0
- Language: TypeScript
- Default Branch: main
- Homepage: https://citation-file-format.github.io/cffinit
- Size: 12 MB
Statistics
- Stars: 27
- Watchers: 1
- Forks: 8
- Open Issues: 90
- Releases: 14
Metadata Files
README.dev.md
Developer documentation
If you are looking for user documentation, go here.
Prerequisites
- npm CLI: Package manager command line interface shipped with NodeJS.
Code editor
- VSCode extensions: https://code.visualstudio.com/
- https://marketplace.visualstudio.com/items?itemName=Vue.volar
- https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
- WebStorm: https://www.jetbrains.com/webstorm/
- Atom: https://atom.io/
- Vim
Virtual environments
nvm or nvs can be used to manage node versions.
Installing the dependencies
The command below will install npm dependencies
shell
npm clean-install
Starting the development server
You can start the development server by running
shell
npm run dev
Use a browser to navigate to localhost:8080/cff-initializer-javascript/ to see the website.
Building the application
The command below will build the application and save the output in docs/ folder. This is what we serve in the demo page.
shell
npm run build
Debugging
Tests
Unit tests
We use Jest for unit tests. The unit tests can be found under test/jest/__tests__/ folder.
You can run the test with
shell
npm run test:unit:ci
You can also use the Majestic web interface to run the unit tests in your browser.
shell
npm run test:unit:ui
End-to-end tests
We use Cypress for end-to-end tests. These tests can be found under the cypress/e2e folder.
You can start Cypress with
shell
npm run cypress:open
Select "E2E Testing", which should be configured already and select the desired browser and click the start button.
A browser will open with the list of tests, which can be explored. It should look like this:
Click on the spec file. The next screen will show the tests being executed. If anything goes wrong, you will see it in red. For more information, check https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#What-you-ll-learn.
Linting and formatting
shell
npm run lint
try to automatically fix linting issues with
shell
npm run lint -- --fix
To run linting on commit, you can install a git commit hook with
shell
npx husky install
Publishing
This app is published using GitHub pages automatically by the Publish workflow. The way this works is:
- After a new tag is created, the workflow runs.
- The workflow builds the app (using the
npm run buildcommand) into the folder./dist. - The GitHub action
peaceiris/actions-gh-pages@v3pushes the contents of./distto the branch gh-pages. - The
gh-pagescontent is served by GitHub into https://citation-file-format.github.io/cff-initializer-javascript/#/
For this to work, a few things have to be set up for first time use:
- A
gh-pageshas to exist before the action is run. You can create an orphan branch to have a clean history with the following commands:
```bash git checkout --orphan gh-pages git rm -rf .
git rm other files and folders if necessary
touch index.html git add index.html git commit -m "gh-pages created" git push origin gh-pages ```
- After
gh-pagesis created, select it as the source for deployment of GitHub pages. - Enable write permissions for
secrets.GITHUB_TOKENon workflows (see, e.g. this post). This is done on Settings -> Actions -> General -> Workflow permissions.
Previewing
This is app is previewed using Netlify automatically by the Preview workflow.
The main branch is previewed into https://cffinit.netlify.app/main and each Pull Request is previewing into a https://cffinit.netlify.app/PRXXX page.
The way this works is:
- The branch
gh-previewis served by Netlify. There is a foldermainand several foldersPRXXXin that branch. - After a Pull Request or a push to
mainis created, the workflow runs. - The workflow changes the
publicPathconfiguration in quasar.conf.js to reflect the foldermainorPRXXX.- This is stored in a environment variable
PUBLICPATHto be used later. - We use
sedwith a-ito replace the value in-place.
- This is stored in a environment variable
- The workflow builds the app (using the
npm run buildcommand) into a folder./dist. - The GitHub action
peaceiris/actions-gh-pages@v3pushes the contents of./distto the branch gh-preview in the indicated path. - After the push is complete, we create a comment on the pull request (if applicable) with the link to the preview page.
For this to work, you need a gh-preview branch to exist and to enable write permissions for secrets.GITHUB_TOKEN.
See the section on Publishing for details on how to do this.
Making a release
This section describes how to make a release in 2 parts:
- preparation
- making a release on GitHub
(1/2) Preparation
- Create a new branch
release-x.y.z. - Run the
update-versionscript runningbash .github/update-version.sh x.y.zand check the result. It should- Update the
version, thedate-released, and possibly other information inCITATION.cff; - Generate an updated version of
.zenodo.jsonif needed usingcffconvert; - Update the
versionfield inpackage.jsonandpackage-lock.json; - Update the version in the landing page footer; and
- Update the version in the app footer.
- Update the
- Run
npm run lintand make sure the linter does not complain. - Run the unit tests with
npm run test:unit:ci. - Run the end-to-end tests with
npm run cypress:run. - Commit and push all changes to GitHub, make a PR.
- Inspect the Netlify preview website.
- Review the PR and merge to the default branch
main.
(2/2) Making a release on GitHub
- Make a release on GitHub.
- Check that the Publish workflow was triggered by making the release, and that it was successful.
- Inspect the deployed github.io website https://citation-file-format.github.io/cff-initializer-javascript/.
- Verify that the Preview workflow was triggered on release deploying a preview of the tag to https://cffinit.netlify.com/TAG.
- Check whether the zenodraft workflow was triggered correctly when the GitHub release was created. If it was not, then trigger it manually.
- Go to Zenodo and verify that the new DOI was created by zenodraft.
References
Links to documentation or tutorials related to technologies/tools we use in the project are shown below. The notes about how we came to this technology stack, design and personas can be found in project-docs/ folder.
- Single Page App: The
cffinitapp will be a SPA. So app feels like a native app and no server-side code needs to run. - Figma: A vector graphics and prototyping editor used to developed the wireframes and interaction designs.
- TypeScript: Typed JavaScript language used for lowering maintenance cost.
- Vue.js v3: A frontend JS framework for building user interfaces.
- Vue.js Composition API: Is style of writing UI components to group logical concerns like state management.
- Quasar: A UI framework, a group of UI components, that follow Material design guidelines to make a coherent/pleasing user interface.
- GitHub pages: Hosting of static HTML files. The build app (in
docsfolder) is deployed on it. - Husky: Automaticly runs checks before pushing changes to GitHub.
- Jest: Testing framework to run unit tests and perform test assertions.
- ESLint: To get constistent code style and prevent errors the industry standard linter ESLint is used.
- Majestic Web UI: Web UI for unit tests using Jest
User stories/Requirements
Update existing CFF
Constraints:
- Files that were not created by cffinit should still be accepted. This implies that
- Fields like
preferred-citationshould be handled. - Old valid files should be handled.
- Fields like
- Ignore or fix small mistakes, to make the experience smoother.
- Updating is like continuing from a finished state, so all screen should be marked as visited.
Here is the list of situations that can happen:
- If the input is not valid YAML, raise an error and don't proceed.
- If the input is not an object, raise an error and don't proceed. This includes vectors and strings.
- Keys at root level that are not part of the
cffobject are passed toextraCffFields. A warning is printed, but proceed. - If an author is not a Person nor Entity, print the infringing fields and drop the author.
- If an author does not have enough fields to check whether it is a Person or Entity (e.g., only orcid), then use Person.
- Keys at nested identifiers levels are ignored. A warning is printed but proceed.
- Radio values ('type' and 'identifiers/type') should be sanitized.
- If an old
cff-versionwas present, warn that a newer version will be used. - If no
cff-versionwas found, no need to warn. - 'date-released' should be sanitized so it is a 'yyyy-mm-dd' string, and not a Javascript date.
- Input validation is only done a posteriori, so don't check it during update.
- Special situations (such as
cff-versionandtypeabove) should be handled explicitly and documented. - If parsing is successful, give positive feedback.
Deprecated:
- Keys at nested levels (e.g., authors) are ignored. A warning is printed, but proceed.
- Deprecated because the author can be a Person or Entity. So to check that, we have to decide based on the fields what to check.
Owner
- Name: citation-file-format
- Login: citation-file-format
- Kind: organization
- Repositories: 13
- Profile: https://github.com/citation-file-format
Citation (CITATION.cff)
abstract: Web form to initialize CITATION.cff files.
authors:
- affiliation: Netherlands eScience Center
family-names: Spaaks
given-names: Jurriaan H.
orcid: https://orcid.org/0000-0002-7064-4069
- affiliation: Netherlands eScience Center
family-names: Verhoeven
given-names: Stefan
orcid: https://orcid.org/0000-0002-5821-2060
- affiliation: Netherlands eScience Center
family-names: Diblen
given-names: Faruk
orcid: https://orcid.org/0000-0002-0989-929X
- affiliation: German Aerospace Center
family-names: Druskat
given-names: Stephan
orcid: https://orcid.org/0000-0003-4925-7248
- affiliation: Netherlands eScience Center
family-names: Soares Siqueira
given-names: Abel
orcid: https://orcid.org/0000-0003-4451-281X
- affiliation: Netherlands eScience Center
family-names: Garcia Gonzalez
given-names: Jesus
orcid: https://orcid.org/0000-0002-2170-3253
- affiliation: Netherlands eScience Center
family-names: Cushing
given-names: Reggie
orcid: https://orcid.org/0000-0002-5967-7302
cff-version: 1.2.0
date-released: 2023-08-08
identifiers:
- type: doi
value: 10.5281/zenodo.8224012
description: >-
This is the identifier used to uniquely identify the version of the
software.
- type: doi
value: 10.5281/zenodo.1404735
description: >-
This is the identifier used to uniquely identify the software as a concept
(i.e., version-agnostic).
keywords:
- citation
- CITATION.cff
- credit
- research software engineering
license: Apache-2.0
message: If you use this software, please cite it using these metadata.
repository-code: https://github.com/citation-file-format/cff-initializer-javascript
title: cffinit
version: 2.3.1
GitHub Events
Total
- Issues event: 4
- Watch event: 6
- Issue comment event: 1
- Fork event: 1
Last Year
- Issues event: 4
- Watch event: 6
- Issue comment event: 1
- Fork event: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 4
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 4
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 4
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- recap (3)
- fkohrt (1)
- graeme-a-stewart (1)
- priya-gitTest (1)
- sdruskat (1)
- KonradHoeffner (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- 1285 dependencies
- @babel/eslint-parser ^7.13.14 development
- @quasar/app ^3.0.0 development
- @quasar/quasar-app-extension-testing ^2.0.0-beta.2 development
- @quasar/quasar-app-extension-testing-unit-jest ^3.0.0-alpha.3 development
- @types/js-yaml ^4.0.2 development
- @types/node ^10.17.15 development
- @typescript-eslint/eslint-plugin ^4.16.1 development
- @typescript-eslint/parser ^4.16.1 development
- eslint ^7.14.0 development
- eslint-config-standard ^16.0.2 development
- eslint-plugin-import ^2.19.1 development
- eslint-plugin-jest ^24.3.6 development
- eslint-plugin-node ^11.0.0 development
- eslint-plugin-promise ^5.1.0 development
- eslint-plugin-vue ^7.0.0 development
- husky ^7.0.1 development
- majestic ^1.7.0 development
- @quasar/extras ^1.0.0
- ajv ^8.6.2
- ajv-formats ^2.1.1
- core-js ^3.6.5
- deep-filter ^1.0.2
- js-yaml ^3.14.1
- kebabcase-keys ^1.0.0
- quasar ^2.0.0
- actions/checkout v3 composite
- actions/setup-node v3 composite
- actions/checkout v3 composite
- citation-file-format/cffconvert-github-action 2.0.0 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- actions/checkout v3 composite
- actions/github-script 0.3.0 composite
- actions/setup-node v3 composite
- peaceiris/actions-gh-pages v3 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- peaceiris/actions-gh-pages v3 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- actions/upload-artifact v3 composite
- codecov/codecov-action v3 composite
- cypress-io/github-action v4 composite
- actions/checkout v3 composite
- zenodraft/action 0.10.0 composite