imsnif / synp

Convert yarn.lock to package-lock.json and vice versa
MIT License
757 stars 41 forks source link

dev dependencies are losing "dev" flag #59

Closed sebastienroux closed 4 years ago

sebastienroux commented 4 years ago

Issue description:

Hello, With last version 1.9.3 when converting yarn.lock, dev dependencies are losing their flag "dev", please compare lock files :

Are you reporting a conversion error? Please include a link to yarn.lock / package-lock.json:

package-lock.json converted with synp package-lock.json from npm install yarn.lock

Are you reporting a conversion error? Please also include a link to your package.json:

{ "name": "angular-version", "version": "0.0.0", "license": "MIT", "private": true, "dependencies": { "rxjs": "~6.6.2" }, "devDependencies": { "protractor": "~7.0.0" } }

antongolub commented 4 years ago

Hey, @sebastienroux,

I've just tweaked up dev flag resolver. From now all the packages that are out of dependencies field of their parents marked as dev. This should help. Release is on the way.

before

if (has(nodeModulesTree[parentPackagePath(mPath)], `devDependencies.${name}`)) {
  entry.dev = true
}

after

if (!has(nodeModulesTree[parentPackagePath(mPath)], `dependencies.${name}`)) {
    entry.dev = true
}
antongolub commented 4 years ago

:tada: This issue has been resolved in version 1.9.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: