Profpatsch / yarn2nix

Build and deploy node packages with nix from yarn.lock files.
MIT License
85 stars 21 forks source link

Yarn-Lock - Fixes yarn.lock for local directory package dependencies #73

Open meghfossa opened 3 years ago

meghfossa commented 3 years ago

This PR aims to fix, case where yarn.lock is created by using local directory package.

For reproduction:

  1. touch package.json

    {
    "name": "name",
    "description": "description",
    "version": "0.1.0",
    "private": true,
    "author": "example",
    "license": "UNLICENSED",
    "scripts": {
      "ci:format": "prettier --check './**/*.js{,x}'"
    },
    "dependencies": {
      "custom-plugin": "file:./custom-plugin/"
    }
    }
  2. Install dependencies with yarn install

  3. It should create following yarn.lock file:

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

"custom-plugin@file:./custom-plugin":
  version "0.0.0"

What happens currently?

When above yarn.lock file is parsed, it leads to: File.UnknownRemoteType Error.

What this PR does?

It creates new Remote type for DirectoryLocal. This allows for successful parsing.

meghfossa commented 3 years ago

Tagging you @Profpatsch for PR review.