switch devDependency to optionalDependency in code that generates package.json