Merge pull request #291918 from dotlambda/typescript-language-server-fetchYarnDeps

typescript-language-server: use fetchYarnDeps
This commit is contained in:
Damien Cassou 2024-07-06 11:07:22 +02:00 committed by GitHub
commit 165204e3d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 92 additions and 26 deletions

View file

@ -12261,6 +12261,12 @@
githubId = 30078229;
name = "marble";
};
marcel = {
email = "me@m4rc3l.de";
github = "MarcelCoding";
githubId = 34819524;
name = "Marcel";
};
marcovergueira = {
email = "vergueira.marco@gmail.com";
github = "marcovergueira";

View file

@ -0,0 +1,85 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchYarnDeps
, fixup-yarn-lock
, makeWrapper
, nodejs
, prefetch-yarn-deps
, yarn
, testers
}:
stdenv.mkDerivation (finalAttrs: {
pname = "typescript-language-server";
version = "4.3.3";
src = fetchFromGitHub {
owner = "typescript-language-server";
repo = "typescript-language-server";
rev = "v${finalAttrs.version}";
hash = "sha256-FCv0+tA7AuCdGeG6FEiMyRAHcl0WbezhNYLL7xp5FWU=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${finalAttrs.src}/yarn.lock";
hash = "sha256-nSMhPfbWD93sGIKehBBE/bh4RzHXFtGAjeyG20m/LWQ=";
};
nativeBuildInputs = [
fixup-yarn-lock
makeWrapper
nodejs
prefetch-yarn-deps
yarn
];
configurePhase = ''
runHook preConfigure
export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror $offlineCache
fixup-yarn-lock yarn.lock
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
patchShebangs node_modules
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
yarn --offline build
runHook postBuild
'';
installPhase = ''
runHook preInstall
yarn --offline --production install
mkdir -p "$out/lib/node_modules/typescript-language-server"
cp -r lib node_modules package.json "$out/lib/node_modules/typescript-language-server"
makeWrapper "${nodejs}/bin/node" "$out/bin/typescript-language-server" \
--add-flags "$out/lib/node_modules/typescript-language-server/lib/cli.mjs"
runHook postInstall
'';
passthru.tests = {
version = testers.testVersion {
package = finalAttrs.finalPackage;
};
};
meta = {
changelog = "https://github.com/typescript-language-server/typescript-language-server/releases/tag/v${finalAttrs.version}";
description = "Language Server Protocol implementation for TypeScript using tsserver";
homepage = "https://github.com/typescript-language-server/typescript-language-server";
license = with lib.licenses; [ asl20 mit ];
mainProgram = "typescript-language-server";
maintainers = with lib.maintainers; [ marcel ];
};
})

View file

@ -171,6 +171,7 @@ mapAliases {
inherit (pkgs) titanium; # added 2023-08-17
triton = pkgs.triton; # Added 2023-05-06
typescript = pkgs.typescript; # Added 2023-06-21
inherit (pkgs) typescript-language-server; # added 2024-02-27
inherit (pkgs) uglify-js; # added 2024-06-15
inherit (pkgs) undollar; # added 2024-06-29
inherit (pkgs) ungit; # added 2023-08-20

View file

@ -51,7 +51,6 @@
pscid = "pscid";
remod-cli = "remod";
teck-programmer = "teck-firmware-upgrade";
typescript-language-server = "typescript-language-server";
vscode-json-languageserver = "vscode-json-languageserver";
webtorrent-cli = "webtorrent";
}

View file

@ -248,7 +248,6 @@
, "tsun"
, "ts-node"
, "ttf2eot"
, "typescript-language-server"
, "unified-language-server"
, "vega-cli"
, "vega-lite"

View file

@ -90157,23 +90157,6 @@ in
bypassCache = true;
reconstructLock = true;
};
typescript-language-server = nodeEnv.buildNodePackage {
name = "typescript-language-server";
packageName = "typescript-language-server";
version = "4.3.3";
src = fetchurl {
url = "https://registry.npmjs.org/typescript-language-server/-/typescript-language-server-4.3.3.tgz";
sha512 = "3QLj57Ru9S6zv10sa4z1pA3TIR1Rdkd04Ke0EszbO4fx5PLdlYhlC/PMxwlyxls9wrZs7wPCME1Ru0s1Gabz4Q==";
};
buildInputs = globalBuildInputs;
meta = {
description = "Language Server Protocol (LSP) implementation for TypeScript using tsserver";
license = "Apache-2.0";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
unified-language-server = nodeEnv.buildNodePackage {
name = "unified-language-server";
packageName = "unified-language-server";

View file

@ -389,13 +389,6 @@ final: prev: {
'';
};
typescript-language-server = prev.typescript-language-server.override {
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];
postInstall = ''
${pkgs.xorg.lndir}/bin/lndir ${pkgs.typescript} $out
'';
};
uppy-companion = prev."@uppy/companion".override {
name = "uppy-companion";
};