From 6ce62cbe08aafb6c3b09c240a0e6bd13290459f4 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 15 Jan 2024 14:14:01 +0100 Subject: [PATCH 1/2] maintainers: add marcel --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 4eadf6503a8a..09a56d7d2364 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -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"; From adea7527ccf355b6485e6fa3f781bc58ef1a1c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 27 Feb 2024 12:34:02 -0800 Subject: [PATCH 2/2] typescript-language-server: use fetchYarnDeps --- .../ty/typescript-language-server/package.nix | 85 +++++++++++++++++++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/main-programs.nix | 1 - .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 17 ---- pkgs/development/node-packages/overrides.nix | 7 -- 6 files changed, 86 insertions(+), 26 deletions(-) create mode 100644 pkgs/by-name/ty/typescript-language-server/package.nix diff --git a/pkgs/by-name/ty/typescript-language-server/package.nix b/pkgs/by-name/ty/typescript-language-server/package.nix new file mode 100644 index 000000000000..053f665ce7eb --- /dev/null +++ b/pkgs/by-name/ty/typescript-language-server/package.nix @@ -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 ]; + }; +}) diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 95a43ea90109..42615e7ded61 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -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 diff --git a/pkgs/development/node-packages/main-programs.nix b/pkgs/development/node-packages/main-programs.nix index 969d6be972df..5983d3d099df 100644 --- a/pkgs/development/node-packages/main-programs.nix +++ b/pkgs/development/node-packages/main-programs.nix @@ -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"; } diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index abd5be19fe4c..0c5ef44b7bfe 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -248,7 +248,6 @@ , "tsun" , "ts-node" , "ttf2eot" -, "typescript-language-server" , "unified-language-server" , "vega-cli" , "vega-lite" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 0d73348130f5..48aeba1d6673 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -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"; diff --git a/pkgs/development/node-packages/overrides.nix b/pkgs/development/node-packages/overrides.nix index c725197bddb6..03a9111d0bce 100644 --- a/pkgs/development/node-packages/overrides.nix +++ b/pkgs/development/node-packages/overrides.nix @@ -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"; };