diff --git a/pkgs/by-name/as/astro-language-server/package.nix b/pkgs/by-name/as/astro-language-server/package.nix new file mode 100644 index 000000000000..9859765bf897 --- /dev/null +++ b/pkgs/by-name/as/astro-language-server/package.nix @@ -0,0 +1,69 @@ +{ + lib, + stdenv, + fetchFromGitHub, + pnpm_8, + nodejs_22, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "astro-language-server"; + version = "2.10.0"; + + src = fetchFromGitHub { + owner = "withastro"; + repo = "language-tools"; + rev = "@astrojs/language-server@${finalAttrs.version}"; + hash = "sha256-WdeQQaC9AVHT+/pXLzaC6MZ6ddHsFSpxoDPHqWvqmiQ="; + }; + + pnpmDeps = pnpm_8.fetchDeps { + inherit (finalAttrs) + pname + version + src + pnpmWorkspace + prePnpmInstall + ; + hash = "sha256-n7HTd/rKxJdQKnty5TeOcyvBU9j/EClQ9IHqbBaEwQE="; + }; + + nativeBuildInputs = [ + nodejs_22 + pnpm_8.configHook + ]; + + buildInputs = [ nodejs_22 ]; + + pnpmWorkspace = "@astrojs/language-server"; + prePnpmInstall = '' + pnpm config set dedupe-peer-dependents false + ''; + + buildPhase = '' + runHook preBuild + + pnpm --filter=@astrojs/language-server build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib/astro-language-server} + cp -r {packages,node_modules} $out/lib/astro-language-server + ln -s $out/lib/astro-language-server/packages/language-server/bin/nodeServer.js $out/bin/astro-ls + + runHook postInstall + ''; + + meta = { + description = "The Astro language server"; + homepage = "https://github.com/withastro/language-tools"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ pyrox0 ]; + mainProgram = "astro-ls"; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 5bbe69039d84..2c59d8a07d76 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -37,6 +37,7 @@ in mapAliases { "@antora/cli" = pkgs.antora; # Added 2023-05-06 + "@astrojs/language-server" = pkgs.astro-language-server; # Added 2024-02-12 "@bitwarden/cli" = pkgs.bitwarden-cli; # added 2023-07-25 "@emacs-eask/cli" = pkgs.eask; # added 2023-08-17 "@forge/cli" = throw "@forge/cli was removed because it was broken"; # added 2023-09-20 diff --git a/pkgs/development/node-packages/main-programs.nix b/pkgs/development/node-packages/main-programs.nix index 92b2d2271c70..b2425ac52962 100644 --- a/pkgs/development/node-packages/main-programs.nix +++ b/pkgs/development/node-packages/main-programs.nix @@ -8,7 +8,6 @@ # Packages that provide a single executable. "@angular/cli" = "ng"; - "@astrojs/language-server" = "astro-ls"; "@babel/cli" = "babel"; "@commitlint/cli" = "commitlint"; "@gitbeaker/cli" = "gitbeaker"; diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 4a23f5a83649..654694325bd6 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -1,7 +1,6 @@ [ "@angular/cli" , "@antfu/ni" -, "@astrojs/language-server" , "@babel/cli" , "@commitlint/cli" , "@commitlint/config-conventional"