chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / ty / typescript-language-server / package.nix
blob8a0c0e8da2d41ab3918753ec3feff6419810f180
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchYarnDeps
5 , fixup-yarn-lock
6 , makeWrapper
7 , nodejs
8 , prefetch-yarn-deps
9 , substituteAll
10 , yarn
11 , testers
12 , typescript
15 stdenv.mkDerivation (finalAttrs: {
16   pname = "typescript-language-server";
17   version = "4.3.3";
19   src = fetchFromGitHub {
20     owner = "typescript-language-server";
21     repo = "typescript-language-server";
22     rev = "v${finalAttrs.version}";
23     hash = "sha256-FCv0+tA7AuCdGeG6FEiMyRAHcl0WbezhNYLL7xp5FWU=";
24   };
26   patches = [
27     (substituteAll {
28       src = ./default-fallbackTsserverPath.diff;
29       typescript = "${typescript}/lib/node_modules/typescript/lib/tsserver.js";
30     })
31   ];
33   offlineCache = fetchYarnDeps {
34     yarnLock = "${finalAttrs.src}/yarn.lock";
35     hash = "sha256-nSMhPfbWD93sGIKehBBE/bh4RzHXFtGAjeyG20m/LWQ=";
36   };
38   nativeBuildInputs = [
39     fixup-yarn-lock
40     makeWrapper
41     nodejs
42     prefetch-yarn-deps
43     yarn
44   ];
46   configurePhase = ''
47     runHook preConfigure
49     export HOME=$(mktemp -d)
50     yarn config --offline set yarn-offline-mirror $offlineCache
51     fixup-yarn-lock yarn.lock
52     yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
53     patchShebangs node_modules
55     runHook postConfigure
56   '';
58   buildPhase = ''
59     runHook preBuild
61     yarn --offline build
63     runHook postBuild
64   '';
66   installPhase = ''
67     runHook preInstall
69     yarn --offline --production install
71     mkdir -p "$out/lib/node_modules/typescript-language-server"
72     cp -r lib node_modules package.json "$out/lib/node_modules/typescript-language-server"
74     makeWrapper "${nodejs}/bin/node" "$out/bin/typescript-language-server" \
75       --add-flags "$out/lib/node_modules/typescript-language-server/lib/cli.mjs"
77     runHook postInstall
78   '';
80   passthru.tests = {
81     version = testers.testVersion {
82       package = finalAttrs.finalPackage;
83     };
84   };
86   meta = {
87     changelog = "https://github.com/typescript-language-server/typescript-language-server/releases/tag/v${finalAttrs.version}";
88     description = "Language Server Protocol implementation for TypeScript using tsserver";
89     homepage = "https://github.com/typescript-language-server/typescript-language-server";
90     license = with lib.licenses; [ asl20 mit ];
91     mainProgram = "typescript-language-server";
92     maintainers = with lib.maintainers; [ marcel ];
93   };