chore(package.json): add dynamic dependencies as optional dependencies (#1228)
chore(package.json): add dynamic dependencies as optional dependencies (#1228)

In order to package the Etcher CLI, we concatenate all the code from the
`lib/cli/etcher.js` entry point using browserify.

There are some dependencies down the hierarchy that dynamically require
other dependencies, by enclosing `require()` calls in `try`/`catch`
blocks. The dynamic dependencies these modules require are not even
present in the `package.json`, and thus rightfully confuse browserify.

See https://github.com/ForbesLindesay/spawn-sync/blob/master/lib/spawn-sync.js#L10
See https://github.com/IndigoUnited/node-cross-spawn/blob/master/index.js#L32

There are two solutions to this problem:

- Make browserify stub these problematic dependencies with a blank file
  by using `--ignore`

This approach initially looks like the way to go, however it means that
every module that requires this particular dependency will receive just
a blank stub. It might be that some other dependencies rely on them, so
this approach could cause very obscure bugs later on.

- Add them to `package.json`

This is the approach taken by this commit. We add them to
`optionalDependencies` instead of `dependencies`, so we can still make
use of tools that analyse the code base for unused dependencies.

Signed-off-by: Juan Cruz Viotti <4148f5869aa1bcd7efd85b513a5874967e585032@openmailbox.org>
resin-io/etcher,resin-io/resin-etcher,resin-io/etcher,resin-io/etcher,resin-io/etcher,resin-io/herostratus,resin-io/etcher,resin-io/herostratus,resin-io/resin-etcher