zenodraft
CLI to manage depositions on Zenodo or Zenodo Sandbox.
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 (11.5%) to scientific vocabulary
Keywords
Repository
CLI to manage depositions on Zenodo or Zenodo Sandbox.
Basic Info
Statistics
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 19
- Releases: 19
Topics
Metadata Files
README.dev.md
Developer documentation
Install
shell
cd some-empty-dir
git clone https://github.com/zenodraft/zenodraft .
git checkout -b <new branch>
npm install
npm run scripts
Clean up generated code from previous builds:
shell
npm run clean
Install dependencies:
shell
npm run install
Transpile the TypeScript code from src/ to dist/ as CommonJS modules (dist/**/*.js) and as ES6
modules (dist/**/*.mjs):
shell
npm run build
Package the contents from dist/ into a distributable tarball:
shell
npm pack
All of the above (clean, install, build, pack):
shell
npm run all
Testing
We use Jest for testing. Run the tests with
```
all tests
npm run test
individual test
npm run test tests/lib/file/add.test.ts
tests with coverage
npm run coverage ```
Many tests use mocking to simulate server replies.
Our mocking library is Nock. Typically, tests that use mocking
will insert simulated server replies using a pre-recorded reply from the ./mocks directory.
Local testing of the cli from the package
Assert tarball zenodraft-x.y.z.tgz has been created with npm pack.
``` cd $(mktemp -d --tmpdir zenodraft.XXXXXX) npm install path/to/the/tarball/zenodraft-x.y.z.tgz --force # --force overrides caching
you should now have a cli program node_modules/.bin/zenodraft, see if it's working
npx zenodraft npx zenodraft --version npx zenodraft --help echo -e '{ "creators": [ { "name": "Lastname, Firstname" } ], "title": "My deposition" }' > .zenodo.json npx zenodraft metadata validate .zenodo.json # should be quiet ```
Local testing of the functionality from the package
Using CommonJS require
Make a file e.g. index.js with the following contents:
javascript
// file: index.js
const zenodraft = require('zenodraft');
console.info(zenodraft);
shell
node index.js
Should show something like:
shell
{
deposition_create_concept: [Getter],
deposition_create_version: [Getter],
deposition_delete: [Getter],
deposition_publish: [Getter],
deposition_show_details: [Getter],
deposition_show_draft: [Getter],
deposition_show_files: [Getter],
deposition_show_prereserved: [Getter],
file_add: [Getter],
file_delete: [Getter],
helpers_get_access_token_from_environment: [Getter],
helpers_get_api: [Getter],
metadata_update: [Getter],
metadata_validate: [Getter]
}
Using ES6 import
Make a file e.g. index.mjs with the following contents (you may use a
different filename but the extension needs to be .mjs):
javascript
// file: index.mjs
import zenodraft from 'zenodraft';
console.info(zenodraft);
shell
node index.mjs
Should show the same as listed above for require.
For maintainers
Order of publishing
- Preparation
- Zenodo
- GitHub
- NPM
Preparation
Before you begin, make sure that
- everything that needs to be part of the release has been
pushed to GitHub and has been merged into the default branch
main. - the citation metadata (e.g. dates,
version, contributors) has been updated (checkCITATION.cffand.zenodo.extras.json) - the version indicators are consistent throughout the whole directory tree, e.g.
CITATION.cffDockerfilepackage-lock.jsonpackage.jsonREADME.mdsrc/cli.tstests/cli.test.ts- possibly other files
Then, follow the steps below.
```shell
Uninstall any globally installed versions of zenodraft
npm uninstall -g zenodraft
Check that it's gone, should return empty
which zenodraft
Delete any environment variables that store Zenodo / Zenodo Sandbox tokens
unset ZENODOACCESSTOKEN unset ZENODOSANDBOXACCESS_TOKEN
Make a temporary directory, change into it
cd $(mktemp -d --tmpdir zenodraft-preparation.XXXXXX)
Clone the repo in the empty temporary directory
git clone https://github.com/zenodraft/zenodraft .
Install dependencies, generate the JavaScript, package it up into a tarball
npm run all
Verify the tarball has the right set of files
less zenodraft-*.tgz
Make a new temporary directory
cd $(mktemp -d --tmpdir zenodraft-testing.XXXXXX)
Install zenodraft globally using the tarball we just made
npm install -g ../zenodraft-preparation.XXXXXX/zenodraft-*.tgz
Source the autocomplete script
TMPFILE=$(mktemp) zenodraft-autocomplete > $TMPFILE source $TMPFILE ```
- Test whether the autocomplete functionality works correctly (see section Autocomplete from README.md).
- Test whether CLI commands work as expected (see section CLI usage from README.md).
- Test whether
zenodraftcan be used as a library (see section Library usage from README.md).
Publishing to Zenodo
Manually triggering the publishing.yml workflow will send a snapshot of the repository to Zenodo.
As part of the process, the workflow will also update the citation metadata with the prereserved DOI
that Zenodo supplies, and commit it back to the repository.
Once the workflow finishes, log in to Zenodo to publish the deposition there.
Publishing to GitHub
After the publishing workflow from the previous step finishes, check that the DOI has been updated,
then use GitHub's Draft a new release button to make a release.
Publishing to NPM
```shell
Go back to the directory with the tarball
cd ../zenodraft-preparation.XXXXXX/zenodraft-*.tgz
Log out of npm
npm logout
Choose your identity and log in to npm
npm login
FINAL STEP, THERE IS NO UNDO: publish the tarball to npmjs.com
npm publish zenodraft-*.tgz ```
Owner
- Name: zenodraft
- Login: zenodraft
- Kind: organization
- Repositories: 3
- Profile: https://github.com/zenodraft
Citation (CITATION.cff)
abstract: CLI to manage depositions on Zenodo or Zenodo Sandbox.
authors:
- affiliation: Netherlands eScience Center
family-names: Spaaks
given-names: Jurriaan H.
orcid: https://orcid.org/0000-0002-7064-4069
cff-version: 1.2.0
date-released: 2024-04-11
identifiers:
- type: doi
value: 10.5281/zenodo.10962433
description: The identifier for this version of zenodraft
- type: doi
value: 10.5281/zenodo.5046392
description: The identifier for all versions of zenodraft, i.e. the concept
keywords:
- zenodo
- cli
license: Apache-2.0
message: If you use this software, please cite it using these metadata.
repository-code: https://github.com/zenodraft/zenodraft
title: zenodraft
type: software
version: 0.14.1
references:
- authors:
- affiliation: Netherlands eScience Center
family-names: Verhoeven
given-names: Stefan
orcid: https://orcid.org/0000-0002-5821-2060
collection-doi: 10.5281/zenodo.3726850
license: Apache-2.0
repository-code: https://github.com/iomega/zenodo-upload/
title: zenodo-upload
type: software
url: https://www.npmjs.com/package/@iomeg/zenodo-upload
GitHub Events
Total
- Issue comment event: 1
- Pull request review event: 1
Last Year
- Issue comment event: 1
- Pull request review event: 1
Issues and Pull Requests
Last synced: 5 months ago
All Time
- Total issues: 43
- Total pull requests: 47
- Average time to close issues: 4 months
- Average time to close pull requests: 3 days
- Total issue authors: 4
- Total pull request authors: 3
- Average comments per issue: 0.88
- Average comments per pull request: 0.77
- Merged pull requests: 44
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jspaaks (39)
- bvreede (2)
- rkrug (1)
- dennisangemi (1)
Pull Request Authors
- jspaaks (50)
- alexlancaster (4)
- yarikoptic (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 127 last-month
- Total dependent packages: 0
- Total dependent repositories: 2
- Total versions: 12
- Total maintainers: 1
npmjs.org: zenodraft
CLI to manage depositions on Zenodo and Zenodo Sandbox
- Homepage: https://github.com/zenodraft/zenodraft
- License: Apache-2.0
-
Latest release: 0.14.1
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- 350 dependencies
- @types/jest ^26.0.23 development
- @types/mime-types ^2.1.0 development
- @types/node ^15.6.1 development
- @types/node-fetch ^2.5.10 development
- jest ^27.0.5 development
- nock ^13.1.1 development
- ts-jest ^27.0.3 development
- typescript ^4.3.2 development
- commander ^7.2.0
- dotenv ^10.0.0
- mime-types ^2.1.31
- node-fetch ^2.6.7
- fair-software/howfairis-github-action 0.2.1 composite
- actions/checkout v2 composite
- zenodraft/action 0.10.0 composite
- actions/checkout v2 composite
- node 14 build
- actions/checkout v4 composite
- codespell-project/actions-codespell v2 composite