Loading pkgs/tools/package-management/yarn-lock-converter/default.nix 0 → 100644 +49 −0 Original line number Diff line number Diff line { lib , buildNpmPackage , fetchurl , nodejs , testers , yarn-lock-converter }: let source = lib.importJSON ./source.json; in buildNpmPackage rec { pname = "yarn-lock-converter"; inherit (source) version; src = fetchurl { url = "https://registry.npmjs.org/@vht/yarn-lock-converter/-/yarn-lock-converter-${version}.tgz"; hash = "sha256-CP1wI33fgtp4GSjasktbfWuUjGzCuK3XR+p64aPAryQ="; }; npmDepsHash = source.deps; dontBuild = true; nativeBuildInputs = [ nodejs ]; postPatch = '' # Use generated package-lock.json as upstream does not provide one ln -s ${./package-lock.json} package-lock.json ''; postInstall = '' mv $out/bin/@vht/yarn-lock-converter $out/bin/yarn-lock-converter rmdir $out/bin/@vht ''; passthru = { tests.version = testers.testVersion { package = yarn-lock-converter; }; updateScript = ./update.sh; }; meta = with lib; { description = "Converts modern Yarn v2+ yarn.lock files into a Yarn v1 format"; homepage = "https://github.com/VHT/yarn-lock-converter"; license = licenses.mit; maintainers = with maintainers; [ gador ]; }; } pkgs/tools/package-management/yarn-lock-converter/package-lock.json 0 → 100644 +592 −0 File added.Preview size limit exceeded, changes collapsed. Show changes pkgs/tools/package-management/yarn-lock-converter/source.json 0 → 100644 +6 −0 Original line number Diff line number Diff line { "version": "0.0.2", "integrity": "sha512-58Oy9qP081Jr+h9EOYB0ItCQ7IfU0RBbkHN4AQR3h6aPDjIOPYTiEyczmTfsLQcAyCFl0MV1kU8QL1xBALKkYw==", "filename": "vht-yarn-lock-converter-0.0.2.tgz", "deps": "sha256-GCTjZ3x+ZgE762yUWQZzEOOwfAr7W0z/cySlehRILf4=" } pkgs/tools/package-management/yarn-lock-converter/update.sh 0 → 100755 +25 −0 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #! nix-shell -i bash -p nodejs libarchive prefetch-npm-deps moreutils # shellcheck shell=bash set -exuo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")" TMPDIR="$(mktemp -d)" trap 'rm -r -- "$TMPDIR"' EXIT pushd -- "$TMPDIR" npm pack "@vht/yarn-lock-converter" --json | jq '.[0] | { version, integrity, filename }' > source.json bsdtar -x -f "$(jq -r .filename source.json)" pushd package npm install --package-lock-only popd DEPS="$(prefetch-npm-deps package/package-lock.json)" jq ".deps = \"$DEPS\"" source.json | sponge source.json popd cp -t . -- "$TMPDIR/source.json" "$TMPDIR/package/package-lock.json" pkgs/top-level/all-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -1767,6 +1767,8 @@ with pkgs; stdenv = clangStdenv; }; yarn-lock-converter = callPackage ../tools/package-management/yarn-lock-converter { }; archi = callPackage ../tools/misc/archi { }; breitbandmessung = callPackage ../applications/networking/breitbandmessung { }; Loading
pkgs/tools/package-management/yarn-lock-converter/default.nix 0 → 100644 +49 −0 Original line number Diff line number Diff line { lib , buildNpmPackage , fetchurl , nodejs , testers , yarn-lock-converter }: let source = lib.importJSON ./source.json; in buildNpmPackage rec { pname = "yarn-lock-converter"; inherit (source) version; src = fetchurl { url = "https://registry.npmjs.org/@vht/yarn-lock-converter/-/yarn-lock-converter-${version}.tgz"; hash = "sha256-CP1wI33fgtp4GSjasktbfWuUjGzCuK3XR+p64aPAryQ="; }; npmDepsHash = source.deps; dontBuild = true; nativeBuildInputs = [ nodejs ]; postPatch = '' # Use generated package-lock.json as upstream does not provide one ln -s ${./package-lock.json} package-lock.json ''; postInstall = '' mv $out/bin/@vht/yarn-lock-converter $out/bin/yarn-lock-converter rmdir $out/bin/@vht ''; passthru = { tests.version = testers.testVersion { package = yarn-lock-converter; }; updateScript = ./update.sh; }; meta = with lib; { description = "Converts modern Yarn v2+ yarn.lock files into a Yarn v1 format"; homepage = "https://github.com/VHT/yarn-lock-converter"; license = licenses.mit; maintainers = with maintainers; [ gador ]; }; }
pkgs/tools/package-management/yarn-lock-converter/package-lock.json 0 → 100644 +592 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
pkgs/tools/package-management/yarn-lock-converter/source.json 0 → 100644 +6 −0 Original line number Diff line number Diff line { "version": "0.0.2", "integrity": "sha512-58Oy9qP081Jr+h9EOYB0ItCQ7IfU0RBbkHN4AQR3h6aPDjIOPYTiEyczmTfsLQcAyCFl0MV1kU8QL1xBALKkYw==", "filename": "vht-yarn-lock-converter-0.0.2.tgz", "deps": "sha256-GCTjZ3x+ZgE762yUWQZzEOOwfAr7W0z/cySlehRILf4=" }
pkgs/tools/package-management/yarn-lock-converter/update.sh 0 → 100755 +25 −0 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #! nix-shell -i bash -p nodejs libarchive prefetch-npm-deps moreutils # shellcheck shell=bash set -exuo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")" TMPDIR="$(mktemp -d)" trap 'rm -r -- "$TMPDIR"' EXIT pushd -- "$TMPDIR" npm pack "@vht/yarn-lock-converter" --json | jq '.[0] | { version, integrity, filename }' > source.json bsdtar -x -f "$(jq -r .filename source.json)" pushd package npm install --package-lock-only popd DEPS="$(prefetch-npm-deps package/package-lock.json)" jq ".deps = \"$DEPS\"" source.json | sponge source.json popd cp -t . -- "$TMPDIR/source.json" "$TMPDIR/package/package-lock.json"
pkgs/top-level/all-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -1767,6 +1767,8 @@ with pkgs; stdenv = clangStdenv; }; yarn-lock-converter = callPackage ../tools/package-management/yarn-lock-converter { }; archi = callPackage ../tools/misc/archi { }; breitbandmessung = callPackage ../applications/networking/breitbandmessung { };