From b284571fd8c51f8a402e345380702659d052b9f9 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 13 Sep 2018 16:59:12 +0100 Subject: [PATCH 1/3] feat: add cid command This PR adds a `jsipfs cid` command with tools for formatting, converting and discovering properties of CIDs. All the docs are here: https://github.com/ipfs-shipyard/js-cid-tool Will resolve this for JS: https://github.com/ipfs/go-ipfs/issues/5229 go-ipfs counterpart: https://github.com/ipfs/go-ipfs/pull/5385 License: MIT Signed-off-by: Alan Shaw --- package.json | 1 + src/cli/commands/cid.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/cli/commands/cid.js diff --git a/package.json b/package.json index 3050a58937..6780af070d 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "boom": "^7.2.0", "bs58": "^4.0.1", "byteman": "^1.3.5", + "cid-tool": "^0.1.0", "cids": "~0.5.3", "debug": "^3.1.0", "err-code": "^1.1.2", diff --git a/src/cli/commands/cid.js b/src/cli/commands/cid.js new file mode 100644 index 0000000000..2738ba0cee --- /dev/null +++ b/src/cli/commands/cid.js @@ -0,0 +1,21 @@ +'use strict' + +const path = require('path') + +const cidCommandsPath = path.join( + __dirname, '..', '..', '..', 'node_modules', 'cid-tool', 'src', 'cli', 'commands' +) + +module.exports = { + command: 'cid ', + + description: 'Convert, format and discover properties of CIDs.', + + builder (yargs) { + return yargs + .commandDir(cidCommandsPath) + }, + + handler (argv) { + } +} From 2a2ecb7dbc6ac996d1c3e5b15b3ff46e34d581b8 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 13 Sep 2018 17:02:25 +0100 Subject: [PATCH 2/3] chore: use ~ License: MIT Signed-off-by: Alan Shaw --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6780af070d..7b3aa922d1 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "boom": "^7.2.0", "bs58": "^4.0.1", "byteman": "^1.3.5", - "cid-tool": "^0.1.0", + "cid-tool": "~0.1.0", "cids": "~0.5.3", "debug": "^3.1.0", "err-code": "^1.1.2", From 19eb126115b5cc1c5f441ecc3060421cc2921005 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 13 Sep 2018 20:12:00 +0100 Subject: [PATCH 3/3] fix: command count License: MIT Signed-off-by: Alan Shaw --- test/cli/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cli/commands.js b/test/cli/commands.js index e6ae40498a..a14a31e826 100644 --- a/test/cli/commands.js +++ b/test/cli/commands.js @@ -4,7 +4,7 @@ const expect = require('chai').expect const runOnAndOff = require('../utils/on-and-off') -const commandCount = 81 +const commandCount = 82 describe('commands', () => runOnAndOff((thing) => { let ipfs