Merge pull request #275 from tgunnoe/gitplus-version-fix

fix: yarn-lock: remove unneeded parsing of version
This commit is contained in:
DavHau 2022-08-31 14:13:57 +02:00 committed by GitHub
commit 666b9452a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 8 deletions

View File

@ -168,14 +168,7 @@
else lib.head split;
version = rawObj: finalObj:
if l.hasInfix "@git+" rawObj.yarnName
then let
split = l.splitString "@git+" rawObj.yarnName;
gitUrl = l.last split;
in
l.strings.sanitizeDerivationName
"${rawObj.version}@git+${gitUrl}"
else if l.hasInfix "@npm:" rawObj.yarnName
if l.hasInfix "@npm:" rawObj.yarnName
then let
split = l.splitString "@" rawObj.version;
version = l.last split;

View File

@ -0,0 +1,28 @@
# test: yarn-lock evaluation with @git+ in versions
#
# Detecting regressions of #275.
#
# Evaluation of a package.json and a yarn.lock with special cases for
# versions would cause mismatches between the two:
# ''error: attribute '*' missing'
#
# 1. package.json has a dependency with a version starting with "@git+"
# 2. yarn resolves it in its yarn.lock file to the proper version and reference
# 3. the two are either not parsed correctly or mismatched on evaluation
#
{
inputs = {
dream2nix.url = "github:nix-community/dream2nix";
};
outputs = {
self,
dream2nix,
}:
dream2nix.lib.makeFlakeOutputs {
systems = ["x86_64-linux"];
config.projectRoot = ./.;
packageOverrides = {};
source = ./.;
};
}

View File

@ -0,0 +1,7 @@
{
"name": "test-git-versions",
"version": "1.0.0",
"dependencies": {
"browser-image-resizer": "git+https://github.com/misskey-dev/browser-image-resizer#v2.2.1-misskey.2"
}
}

View File

@ -0,0 +1,7 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"browser-image-resizer@git+https://github.com/misskey-dev/browser-image-resizer#v2.2.1-misskey.2":
version "2.2.1-misskey.2"
resolved "git+https://github.com/misskey-dev/browser-image-resizer#a58834f5fe2af9f9f31ff115121aef3de6f9d416"