imsnif / synp

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

Does not include optionalDependencies when translating yarn.lock to package-lock.json #103

Open staticshock opened 8 months ago

staticshock commented 8 months ago

Issue description:

I'm using yarn with Next.js v14, which declares some optional dependencies. When I run yarn synp --source-file yarn.lock those dependencies do not get carried over into package-lock.json. When I start the next dev server, I see this:

 ⚠ Found lockfile missing swc dependencies, patching...
 ⚠ Lockfile was successfully patched, please run "npm install" to ensure @next/swc dependencies are downloaded

So, clearly it expected those optional dependencies to be reflected in the package-lock.json, but I can't get synp to generate a file that includes them.

Relevant snippet of yarn.lock:

"@swc/core-darwin-arm64@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.105.tgz#2960f8a87aed01b3850d5c37f05b51d9d3747141"
  integrity sha512-buWeweLVDXXmcnfIemH4PGnpjwsDTUGitnPchdftb0u1FU8zSSP/lw/pUCBDG/XvWAp7c/aFxgN4CyG0j7eayA==

"@swc/core-darwin-x64@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.105.tgz#aaa502f902dec1e4735a0a37a4fcc3a2c0369882"
  integrity sha512-hFmXPApqjA/8sy/9NpljHVaKi1OvL9QkJ2MbbTCCbJERuHMpMUeMBUWipHRfepGHFhU+9B9zkEup/qJaJR4XIg==

"@swc/core-linux-arm-gnueabihf@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.105.tgz#5a8629c75db4fe298ca3fdb18ecbc7888cd34759"
  integrity sha512-mwXyMC41oMKkKrPpL8uJpOxw7fyfQoVtIw3Y5p0Blabk+espNYqix0E8VymHdRKuLmM//z5wVmMsuHdGBHvZeg==

"@swc/core-linux-arm64-gnu@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.105.tgz#9cae768a92944774511a569dffca45f1beab7cdd"
  integrity sha512-H7yEIVydnUtqBSUxwmO6vpIQn7j+Rr0DF6ZOORPyd/SFzQJK9cJRtmJQ3ZMzlJ1Bb+1gr3MvjgLEnmyCYEm2Hg==

"@swc/core-linux-arm64-musl@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.105.tgz#9244aabe4a7884d3d81df707d3e3c3478953a454"
  integrity sha512-Jg7RTFT3pGFdGt5elPV6oDkinRy7q9cXpenjXnJnM2uvx3jOwnsAhexPyCDHom8SHL0j+9kaLLC66T3Gz1E4UA==

"@swc/core-linux-x64-gnu@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.105.tgz#7fde7b8a2ab7f5152e2dc37abf95f9add2c46937"
  integrity sha512-DJghplpyusAmp1X5pW/y93MmS/u83Sx5GrpJxI6KLPa82+NItTgMcl8KBQmW5GYAJpVKZyaIvBanS5TdR8aN2w==

"@swc/core-linux-x64-musl@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.105.tgz#a8d96fc532427f353696283c70ae13e7fcc18358"
  integrity sha512-wD5jL2dZH/5nPNssBo6jhOvkI0lmWnVR4vnOXWjuXgjq1S0AJpO5jdre/6pYLmf26hft3M42bteDnjR4AAZ38w==

"@swc/core-win32-arm64-msvc@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.105.tgz#35edc1d898d7e9994fd6986b4c0085b3f1d59ec5"
  integrity sha512-UqJtwILUHRw2+3UTPnRkZrzM/bGdQtbR4UFdp79mZQYfryeOUVNg7aJj/bWUTkKtLiZ3o+FBNrM/x2X1mJX5bA==

"@swc/core-win32-ia32-msvc@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.105.tgz#5e538fd63b648d8c5bf9c22371c5e273c208f961"
  integrity sha512-Z95C6vZgBEJ1snidYyjVKnVWiy/ZpPiIFIXGWkDr4ZyBgL3eZX12M6LzZ+NApHKffrbO4enbFyFomueBQgS2oA==

"@swc/core-win32-x64-msvc@1.3.105":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.105.tgz#efd50adf2fdc1b9e5ad4df0e165d48d71ea5d7f3"
  integrity sha512-3J8fkyDPFsS3mszuYUY4Wfk7/B2oio9qXUwF3DzOs2MK+XgdyMLIptIxL7gdfitXJBH8k39uVjrIw1JGJDjyFA==

"@swc/core@^1.3.82":
  version "1.3.105"
  resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.105.tgz#2b78db067b2dc90f3f398a08bb649a3d2ad74e8e"
  integrity sha512-me2VZyr3OjqRpFrYQJJYy7x/zbFSl9nt+MAGnIcBtjDsN00iTVqEaKxBjPBFQV9BDAgPz2SRWes/DhhVm5SmMw==
  dependencies:
    "@swc/counter" "^0.1.1"
    "@swc/types" "^0.1.5"
  optionalDependencies:
    "@swc/core-darwin-arm64" "1.3.105"
    "@swc/core-darwin-x64" "1.3.105"
    "@swc/core-linux-arm-gnueabihf" "1.3.105"
    "@swc/core-linux-arm64-gnu" "1.3.105"
    "@swc/core-linux-arm64-musl" "1.3.105"
    "@swc/core-linux-x64-gnu" "1.3.105"
    "@swc/core-linux-x64-musl" "1.3.105"
    "@swc/core-win32-arm64-msvc" "1.3.105"
    "@swc/core-win32-ia32-msvc" "1.3.105"
    "@swc/core-win32-x64-msvc" "1.3.105"

Relevant snippet of package.json:

  "dependencies": {
    "next": "^14.1.0",
    …
  },