@@ -217,7 +217,7 @@ async function main (input, _opts = {}) {
217
217
} ) ( )
218
218
219
219
opts = options . values ( )
220
- return write ( path . resolve ( opts . cwd , 'package.json' ) , opts , await format ( opts , pkg ) , { log } )
220
+ return write ( opts , await format ( opts , pkg ) , { log } )
221
221
}
222
222
223
223
module . exports . options = initOpts ( ) . options
@@ -302,6 +302,8 @@ async function format (opts, pkg = {}) {
302
302
pkg . peerDependencies = { }
303
303
304
304
await Promise . all ( opts . peerDependencies . map ( async ( name ) => {
305
+ // @TODO we should align peer deps with the associated
306
+ // devDep or prodDep semver range
305
307
const spec = await npm . normalizePackageName ( name )
306
308
let ver
307
309
switch ( spec . type ) {
@@ -320,7 +322,8 @@ async function format (opts, pkg = {}) {
320
322
321
323
module . exports . write = write
322
324
// TODO: look at https://npm.im/json-file-plus for writing
323
- async function write ( pkgPath , opts , pkg , { log } = { } ) {
325
+ async function write ( opts , pkg , { log } = { } ) {
326
+ const pkgPath = path . resolve ( opts . cwd , 'package.json' )
324
327
// Write package json
325
328
log . info ( `Writing package.json\n${ pkgPath } ` )
326
329
await fs . outputJSON ( pkgPath , pkg , {
0 commit comments