8 angular-language-server,
11 common-updater-scripts,
17 repo = "vscode-ng-language-service";
19 stdenvNoCC.mkDerivation (finalAttrs: {
20 pname = "angular-language-server";
23 name = "${finalAttrs.pname}-${finalAttrs.version}.zip";
24 url = "https://github.com/${owner}/${repo}/releases/download/v${finalAttrs.version}/ng-template.vsix";
25 hash = "sha256-rl04nqSSBMjZfPW8Y+UtFLFLDFd5FSxJs3S937mhDWE=";
33 buildInputs = [ nodejs ];
37 install -Dm755 server/bin/ngserver $out/lib/bin/ngserver
38 install -Dm755 server/index.js $out/lib/index.js
39 cp -r node_modules $out/lib/node_modules
44 patchShebangs $out/lib/bin/ngserver $out/lib/index.js $out/lib/node_modules
45 makeWrapper $out/lib/bin/ngserver $out/bin/ngserver \
46 --prefix PATH : ${lib.makeBinPath [ nodejs ]} \
47 --add-flags "--tsProbeLocations $out/lib/node_modules --ngProbeLocations $out/lib/node_modules"
52 start-ok = runCommand "${finalAttrs.pname}-test" { } ''
53 ${lib.getExe angular-language-server} --stdio --help &> $out
54 cat $out | grep "Angular Language Service that implements the Language Server Protocol (LSP)"
58 updateScript = lib.getExe (writeShellApplication {
59 name = "update-${finalAttrs.pname}";
62 common-updater-scripts
65 if [ -z "''${GITHUB_TOKEN:-}" ]; then
66 echo "no GITHUB_TOKEN provided - you could meet API request limiting" >&2
69 LATEST_VERSION=$(curl -H "Accept: application/vnd.github+json" \
70 ''${GITHUB_TOKEN:+-H "Authorization: bearer $GITHUB_TOKEN"} \
71 -Lsf https://api.github.com/repos/${owner}/${repo}/releases/latest | \
72 jq -r .tag_name | cut -c 2-)
73 update-source-version ${finalAttrs.pname} "$LATEST_VERSION"
79 description = "LSP for angular completions, AOT diagnostic, quick info and go to definitions";
80 homepage = "https://github.com/angular/vscode-ng-language-service";
81 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
82 changelog = "https://github.com/angular/vscode-ng-language-service/blob/${finalAttrs.version}/CHANGELOG.md";
83 license = lib.licenses.mit;
84 platforms = lib.platforms.unix;
85 mainProgram = "ngserver";
86 maintainers = with lib.maintainers; [ tricktron ];