Open skoblenick opened 7 years ago
The mistake is here:
var _pkgJson$dependencies = pkgJson.dependencies;
var outDeps = _pkgJson$dependencies === undefined ? {} : _pkgJson$dependencies;
when dependencies
is undefined
in pkgJson
, outDeps
is initialized to an empty object which is not referenced by _pkgJson
; same thing goes for devDependencies
.
The bug stems from the fact pkgJson
is first modified and then exported:
var newPkg = pkgJson;
I think that creating a new object from scratch (rather than modifying the existing one through variable aliases) would be a better approach.
I don't think referencing the transpiled code is going to be all that useful for debugging, but I appreciate your effort.
I will look into the issue when I have time, if nobody else submits a PR that fixes it before then. Thanks.
Scenario: 1 . Have a
bower.json
withdependencies
anddevDependencies
.package.json
withdevDependencies
and withoutdependencies
(key doesn't exist)bower-migrate
Actual Result: The migration copies in the
devDependencies
but doesn't create adependencies
key in package.json which results in none of the dependencies being migrated.Work Around: Add the dependencies key to the package.json set to an empty literal and re-run.
Expected Behavior: Both dependencies and devDependencies would be created in the package.json regardless if they exist or not.