You should have node.js and npm installed.
Linting is done using eslint and the rules are based on standard.
$ npm run lint
Tests in node
$ npm run test:node
Tests in the browser
$ npm run test:browser
The core interface tests are kept in a separate repo, because they are used by multiple other projects. To add a core interface test, follow this guide:
- Clone this project repo and the interface core tests repo:
git clone https://github.com/ipfs/js-ipfs-http-client.git
git clone https://github.com/ipfs/interface-js-ipfs-core.git
- Install dependencies and globally link the interface core tests:
cd interface-js-ipfs-core
npm install
npm link
- Write your test
- Install dependencies for this project and link to the interface core tests
cd ../js-ipfs-http-client
npm install
npm link interface-ipfs-core
- Run the tests:
npm test
Next:
- Send a PR to
ipfs/interface-js-ipfs-core
(please also add to the documentation!) - This will be reviewed by a core contributor and they will perform the same steps as above
- When merged, a new version of
interface-ipfs-core
will be released - Finally, a PR needs to be created or updated to
ipfs/js-ipfs-http-client
to use the new version
$ npm run build
The release
task will
- Run a build
- Commit the build
- Bump the version in
package.json
- Commit the version change
- Create a git tag
- Run
git push
toupstream/master
(You can change this with--remote my-remote
)
# Major release
$ npm run release-major
# Minor relase
$ npm run release-minor
# Patch release
$ npm run release