ktym / d3sparql

JavaScript library for executing SPARQL query and transforming resulted JSON for visualization in D3.js
189 stars 76 forks source link

Prepare to publish as npm package #23

Open ursm opened 4 years ago

ursm commented 4 years ago

I have prepared to publish d3sparql.js as npm package.

It automatically generates Node.js build (dist/d3sparql.cjs) and browser build (dist/d3sparql.js) from the source code using the ECMAScript module (src/d3sparql.mjs). This is a similar mechanism to sparql-support.

There is already a library named d3-sparql, and npm didn't allow us to give it a similar name. Hence the name of this package is @ktym/d3sparql.

As an example, here's how to use this package from TogoStanza:

$ npm install @kytm/d3sparql
// stanzas/foo/index.js
import d3sparql from '@ktym/d3sparql';

After merging the pull request, follow these steps:

  1. npm version minor: Increment the package version (0.0.0 -> 0.1.0 in this case), commit and create a git tag
  2. git push --tags: Push that commit and tag to GitHub
  3. npm publish --access public: Submit this package to the npm registry
ursm commented 4 years ago

If you want to try it out locally before merging, you can install it with the following command:

$ npm install 'ursm/d3sparql#publish'