
use nix-update basedpyright: 1.11.0 -> 1.12.1 basedpyright: 1.12.2 -> 1.12.2 Diff: https://github.com/detachhead/basedpyright/compare/v1.12.2...v1.12.2 Changelog: https://github.com/detachhead/basedpyright/releases/tag/1.12.2 basedpyright: 1.12.2 -> 1.12.3 Changelog: https://github.com/DetachHead/basedpyright/compare/v1.12.2...v1.12.3
90 lines
2.3 KiB
Nix
90 lines
2.3 KiB
Nix
{
|
|
lib,
|
|
nix-update-script,
|
|
buildNpmPackage,
|
|
fetchFromGitHub,
|
|
runCommand,
|
|
jq,
|
|
}:
|
|
|
|
let
|
|
version = "1.12.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "detachhead";
|
|
repo = "basedpyright";
|
|
rev = "v${version}";
|
|
hash = "sha256-n4jiKxkXGCKJkuXSsUktsiJQuCcZ+D/RJH/ippnOVw8=";
|
|
};
|
|
|
|
patchedPackageJSON = runCommand "package.json" { } ''
|
|
${jq}/bin/jq '
|
|
.devDependencies |= with_entries(select(.key == "glob" or .key == "jsonc-parser"))
|
|
| .scripts = { }
|
|
' ${src}/package.json > $out
|
|
'';
|
|
|
|
pyright-root = buildNpmPackage {
|
|
pname = "pyright-root";
|
|
inherit version src;
|
|
npmDepsHash = "sha256-63kUhKrxtJhwGCRBnxBfOFXs2ARCNn+OOGu6+fSJey4=";
|
|
dontNpmBuild = true;
|
|
postPatch = ''
|
|
cp ${patchedPackageJSON} ./package.json
|
|
cp ${./package-lock.json} ./package-lock.json
|
|
'';
|
|
installPhase = ''
|
|
runHook preInstall
|
|
cp -r . "$out"
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
|
|
pyright-internal = buildNpmPackage {
|
|
pname = "pyright-internal";
|
|
inherit version src;
|
|
sourceRoot = "${src.name}/packages/pyright-internal";
|
|
npmDepsHash = "sha256-ba7GzkKrXps4W1ptv+j9fMMXwpi30ymbqgIJ64PaZ1g=";
|
|
dontNpmBuild = true;
|
|
# FIXME: Remove this flag when TypeScript 5.5 is released
|
|
npmFlags = [ "--legacy-peer-deps" ];
|
|
installPhase = ''
|
|
runHook preInstall
|
|
cp -r . "$out"
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
in
|
|
buildNpmPackage rec {
|
|
pname = "basedpyright";
|
|
inherit version src;
|
|
|
|
sourceRoot = "${src.name}/packages/pyright";
|
|
npmDepsHash = "sha256-9V1T6w1G1SZi19dgRaFmv+Vy71hmQR+L6cDjQZJrGy8=";
|
|
|
|
postPatch = ''
|
|
chmod +w ../../
|
|
ln -s ${pyright-root}/node_modules ../../node_modules
|
|
chmod +w ../pyright-internal
|
|
ln -s ${pyright-internal}/node_modules ../pyright-internal/node_modules
|
|
'';
|
|
|
|
postInstall = ''
|
|
mv "$out/bin/pyright" "$out/bin/basedpyright"
|
|
mv "$out/bin/pyright-langserver" "$out/bin/basedpyright-langserver"
|
|
'';
|
|
|
|
dontNpmBuild = true;
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
changelog = "https://github.com/detachhead/basedpyright/releases/tag/${version}";
|
|
description = "Type checker for the Python language";
|
|
homepage = "https://github.com/detachhead/basedpyright";
|
|
license = lib.licenses.mit;
|
|
mainProgram = "basedpyright";
|
|
maintainers = with lib.maintainers; [ kiike ];
|
|
};
|
|
}
|