Citeproc-js npm package

Dear list,

I’d like to follow up on this issue:
https://bitbucket.org/fbennett/citeproc-js/issue/120/create-npm-package-for-nodejs

In one of my previous projects I needed to run citeproc-js in Node.js. I
tried citeproc-node but it was a bit too much overhead. I wanted to call
citeproc-js directly without needing to start a web server. Also
citeproc-node is not available in the npm registry and even if it was it
would not fit node’s philosophy of small kernels of functionality.

So, I created a very small npm package containing only citeproc.js and
csl_nodejs_jsdom.js from citeproc-node. It works really well and fits
perfectly in the nodejs world.

I wonder if it would be worthwile pushing this package to the npm
registry, so that everyone can use it. I would be able to maintain the
package and keep it up to date, but of course I understand this is for
you to decide.

Cheers,
Michel

I would be able to maintain the package and keep it up to date,
but of course I understand this is for you to decide.

Does citeproc have integration with Travis or other CI systems that
could be used to publish to npm automatically?

It doesn’t at the moment.

The actual processor test suite for citeproc-js is a cumbersome thing
that I run offline, but I suppose Travis could be used for the limited
purpose of pushing a tagged release to npm. I don’t have any
experience with setting up Travis, though, so if it’s left to me, it
will probably be awhile before I get around to it …

Frank

As far as I know, in order to publish to the npm registry you need to
have a valid username and a password. Performing this process
automatically would require you to store the password in the source
repository or somewhere else. I’m not sure if Travis offers some kind of
a credentials store to handle such cases, but I doubt they do.

Just an additional thought, Frank. If you could describe what these
’cumbersome’ things are that you need to perform to run the test suite I
may be able to help you automate it with Travis. What do you think?

Cheers,
Michel

See http://docs.travis-ci.com/user/deployment/npm/

Thanks, Ritze. I wasn’t aware about this site. So you can generate an
API key for the npm registry and this key can be encrypted by Travis.
That’s great news.

Cheers,
Michel

So you can generate an
API key for the npm registry and this key can be encrypted by Travis.
That’s great news.

Yes, indeed you can. I’ve got a project on github which automatically
publishes the master branch to npm.
The only part that wasn’t conveniently built-in was bumping the
version number on commit.
I wrote a utility that bumps the version number on commit by taking a
’base’ version number and using
the number of commits in master as the patch version in package.json -
https://github.com/robertknight/passcards/blob/master/utils/update-manifest-version.js