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

View File

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