rescript-language-server: Fix updateScript

This commit is contained in:
Ross Smyth 2025-06-23 15:07:01 -04:00
parent aa85c1a5f5
commit f453876754
2 changed files with 19 additions and 14 deletions

View File

@ -1,6 +1,7 @@
{
lib,
fetchFromGitHub,
nix-update-script,
ocamlPackages,
}:
@ -13,8 +14,8 @@ ocamlPackages.buildDunePackage rec {
src = fetchFromGitHub {
owner = "rescript-lang";
repo = "rescript-vscode";
rev = version;
hash = "sha256-v+qCVge57wvA97mtzbxAX9Fvi7ruo6ZyIC14O8uWl9Y=";
tag = version;
hash = "sha256-Tox5Qq0Kpqikac90sQww2cGr9RHlXnVy7GMnRA18CoA=";
};
strictDeps = true;
@ -22,12 +23,21 @@ ocamlPackages.buildDunePackage rec {
ocamlPackages.cppo
];
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"([0-9]+\.[0-9]+\.[0-9]+)"
];
};
meta = {
description = "Analysis binary for the ReScript VSCode plugin";
homepage = "https://github.com/rescript-lang/rescript-vscode";
maintainers = [
lib.maintainers.dlip
lib.maintainers.jayesh-bhoot
changelog = "https://github.com/rescript-lang/rescript-vscode/releases/tag/${version}";
maintainers = with lib.maintainers; [
dlip
jayesh-bhoot
RossSmyth
];
license = lib.licenses.mit;
mainProgram = "rescript-editor-analysis";

View File

@ -20,18 +20,13 @@ let
throw "Unsupported system: ${stdenv.system}";
in
buildNpmPackage rec {
# These have the same source, and must be the same version.
inherit (rescript-editor-analysis) src;
pname = "rescript-language-server";
inherit version;
src = fetchFromGitHub {
owner = "rescript-lang";
repo = "rescript-vscode";
tag = version;
hash = "sha256-Tox5Qq0Kpqikac90sQww2cGr9RHlXnVy7GMnRA18CoA=";
};
sourceRoot = "${src.name}/server";
npmDepsHash = "sha256-Qi41qDJ0WR0QWw7guhuz1imT51SqI7mORGjNbmZWnio=";
npmDepsHash = "sha256-Qi41qDJ0WR0QWw7guhuz1imT51SqI7mORGjNbmZWnio";
strictDeps = true;
nativeBuildInputs = [ esbuild ];
@ -57,7 +52,7 @@ buildNpmPackage rec {
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex" "([0-9]\.[0-9][0-9]\.[0-9])"]; };
meta = {
description = "ReScript Language Server";