Skip to content

Commit

Permalink
fix: make no-kafka optional dependency (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Mar 5, 2018
1 parent d66a2aa commit 5d97654
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion commands/topics_tail.js
Expand Up @@ -2,7 +2,6 @@

const cli = require('heroku-cli-util')
const co = require('co')
const kafka = require('no-kafka')

const debug = require('../lib/debug')
const clusterConfig = require('../lib/shared').clusterConfig
Expand All @@ -15,6 +14,7 @@ const IDLE_TIMEOUT = 1000
const MAX_LENGTH = 80

function * tail (context, heroku) {
const kafka = require('no-kafka')
yield withCluster(heroku, context.app, context.args.CLUSTER, function * (addon) {
if (isPrivate(addon)) {
throw new Error('`kafka:topics:tail` is not available in Heroku Private Spaces')
Expand Down
2 changes: 1 addition & 1 deletion commands/topics_write.js
Expand Up @@ -2,7 +2,6 @@

const cli = require('heroku-cli-util')
const co = require('co')
const kafka = require('no-kafka')

const debug = require('../lib/debug')
const clusterConfig = require('../lib/shared').clusterConfig
Expand All @@ -14,6 +13,7 @@ const CLIENT_ID = 'heroku-write-producer'
const IDLE_TIMEOUT = 1000

function * write (context, heroku) {
const kafka = require('no-kafka')
yield withCluster(heroku, context.app, context.args.CLUSTER, function * (addon) {
if (isPrivate(addon)) {
cli.exit(1, '`kafka:topics:write` is not available in Heroku Private Spaces')
Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -14,9 +14,11 @@
"heroku-cli-util": "6.1.17",
"humanize-plus": "^1.8.2",
"lodash.uniqby": "4.7.0",
"no-kafka": "github:hunterloftis/kafka",
"node-spinner": "0.0.4"
},
"optionalDependencies": {
"no-kafka": "github:hunterloftis/kafka"
},
"devDependencies": {
"chai": "^3.5.0",
"chai-as-promised": "^5.3.0",
Expand Down

0 comments on commit 5d97654

Please sign in to comment.