Comparing version 7.1.5 to 8.0.2
55
cli.js
@@ -57,22 +57,23 @@ #!/usr/bin/env node | ||
Options: | ||
--seed Start a headless seed for the specified cabal key | ||
--seed Start a headless seed for the specified cabal key | ||
--new Start a new cabal | ||
--nick Your nickname | ||
--alias Save an alias for the specified cabal, use with --key | ||
--aliases Print out your saved cabal aliases | ||
--forget Forgets the specified alias | ||
--clear Clears out all aliases | ||
--key Specify a cabal key. Used with --alias | ||
--join Only join the specified cabal, disregarding whatever is in the config | ||
--config Specify a full path to a cabal config | ||
--new Start a new cabal | ||
--nick Your nickname | ||
--alias Save an alias for the specified cabal, use with --key | ||
--aliases Print out your saved cabal aliases | ||
--forget Forgets the specified alias | ||
--clear Clears out all aliases | ||
--key Specify a cabal key. Used with --alias | ||
--join Only join the specified cabal, disregarding whatever is in the config | ||
--config Specify a full path to a cabal config | ||
--temp Start the cli with a temporary in-memory database. Useful for debugging | ||
--version Print out which version of cabal you're running | ||
--help Print this help message | ||
--temp Start the cli with a temporary in-memory database. Useful for debugging | ||
--version Print out which version of cabal you're running | ||
--help Print this help message | ||
--message Publish a single message; then quit after \`timeout\` | ||
--channel Channel name to publish to for \`message\` option; default: "default" | ||
--timeout Delay in milliseconds to wait on swarm before quitting for \`message\` option; default: 5000 | ||
--type Message type set to message for \`message\` option; default: "chat/text" | ||
--message Publish a single message; then quit after \`timeout\` | ||
--channel Channel name to publish to for \`message\` option; default: "default" | ||
--timeout Delay in milliseconds to wait on swarm before quitting for \`message\` option; default: 5000 | ||
--type Message type set to message for \`message\` option; default: "chat/text" | ||
--offline Disable networking | ||
@@ -274,12 +275,16 @@ Work in progress! Learn more at https://github.com/cabal-club | ||
}) | ||
setTimeout(() => { | ||
if (!args.offline) { | ||
setTimeout(() => { | ||
cabals.forEach((cabal) => { | ||
cabal.swarm() | ||
}) | ||
}, 300) | ||
} | ||
} else { | ||
if (!args.offline) { | ||
cabals.forEach((cabal) => { | ||
console.log('Seeding', cabal.key) | ||
cabal.swarm() | ||
}) | ||
}, 300) | ||
} else { | ||
cabals.forEach((cabal) => { | ||
console.log('Seeding', cabal.key) | ||
cabal.swarm() | ||
}) | ||
} | ||
} | ||
@@ -331,5 +336,5 @@ } | ||
}) | ||
cabal.swarm() | ||
if (!args.offline) cabal.swarm() | ||
setTimeout(function () { process.exit(0) }, timeout || 5000) | ||
}) | ||
} |
@@ -160,3 +160,3 @@ var util = require('./util') | ||
line = line.trim() | ||
if (line !== '' && self.channel !== "!status") { | ||
if (line !== '' && self.channel !== '!status') { | ||
self.cabal.publish({ | ||
@@ -163,0 +163,0 @@ type: 'chat/text', |
@@ -1,3 +0,3 @@ | ||
var ansiEscapes = require("ansi-escapes") | ||
var supportsHyperlinks = require("supports-hyperlinks") | ||
var ansiEscapes = require('ansi-escapes') | ||
var supportsHyperlinks = require('supports-hyperlinks') | ||
@@ -7,3 +7,3 @@ var linkPattern = /(\[(.+?)\]\((\S+)\))/ | ||
function linkify (text, url) { | ||
return supportsHyperlinks.stdout ? ansiEscapes.link(text, url) : `${text} (${url})` | ||
return supportsHyperlinks.stdout ? ansiEscapes.link(text, url) : `${text} (${url})` | ||
} | ||
@@ -10,0 +10,0 @@ |
var Cabal = require('cabal-core') | ||
var chalk = require('chalk') | ||
var stripAnsi = require('strip-ansi') | ||
var collect = require('collect-stream') | ||
@@ -11,4 +10,2 @@ var Commander = require('./commands.js') | ||
var yaml = require('js-yaml') | ||
var emojiRegex = require('emoji-regex') | ||
var emojiPattern = emojiRegex() | ||
var util = require('./util') | ||
@@ -439,7 +436,5 @@ | ||
/* sanitize input to prevent interface from breaking */ | ||
// emojis.break the cli: replace them with a cabal symbol | ||
var msgtxt = msg.value.content.text.replace(emojiPattern, '➤') | ||
var msgtxt = msg.value.content.text | ||
if (msg.key !== 'status') { | ||
msgtxt = stripAnsi(msgtxt) // strip non-visible sequences | ||
msgtxt = msgtxt.replace(/[\u0000-\u0009]|[\u000b-\u001f]/g, '') // keep newline (aka LF aka ascii character 10 aka \u000a) | ||
msgtxt = util.sanitizeString(msgtxt) | ||
} | ||
@@ -446,0 +441,0 @@ |
{ | ||
"name": "cabal-cli", | ||
"version": "7.1.5", | ||
"version": "8.0.2", | ||
"description": "p2p chat", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"ansi-escapes": "^4.2.0", | ||
"cabal-core": "^6.0.0", | ||
"cabal-core": "^7.0.0", | ||
"cabal-dns": "^1.0.1", | ||
@@ -14,0 +14,0 @@ "chalk": "^2.4.1", |
12
util.js
@@ -0,1 +1,5 @@ | ||
var stripAnsi = require('strip-ansi') | ||
var emojiRegex = require('emoji-regex') | ||
var emojiPattern = emojiRegex() | ||
function log (err, result) { | ||
@@ -6,2 +10,8 @@ if (err) { console.error('hyperdb failed with', err) } | ||
function sanitizeString (str) { | ||
// emojis.break the cli: replace them with a cabal symbol | ||
str = str.replace(emojiPattern, '➤') | ||
str = stripAnsi(str) // strip non-visible sequences | ||
return str.replace(/[\u0000-\u0009]|[\u000b-\u001f]/g, '') // keep newline (aka LF aka ascii character 10 aka \u000a) | ||
} | ||
// Character-wrap text containing ANSI escape codes. | ||
@@ -104,2 +114,2 @@ // String, Int -> [String] | ||
module.exports = { cmpUser, log, wrapAnsi, strlenAnsi, centerText, rightAlignText, wrapStatusMsg } | ||
module.exports = { cmpUser, log, wrapAnsi, strlenAnsi, centerText, rightAlignText, wrapStatusMsg, sanitizeString } |
@@ -166,3 +166,3 @@ var output = require('./output') | ||
var topic = state.topic || state.channel | ||
var line = '➤ ' + topic | ||
var line = '➤ ' + util.sanitizeString(topic) | ||
line = line.substring(0, width - 1) | ||
@@ -169,0 +169,0 @@ if (line.length === width - 1) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2398089
25
1216
+ Addedcabal-core@7.2.1(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addedduplexify@4.1.3(transitive)
+ Addedfilter-obj@1.1.0(transitive)
+ Addedmaterialized-group-auth@1.3.0(transitive)
+ Addedquery-string@6.14.1(transitive)
+ Addedsplit-on-first@1.1.0(transitive)
+ Addedstream-shift@1.0.3(transitive)
+ Addedstrict-uri-encode@2.0.0(transitive)
- Removedcabal-core@6.0.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedstring_decoder@1.3.0(transitive)
Updatedcabal-core@^7.0.0