9 stdenv.mkDerivation (finalAttrs: {
10 pname = "astro-language-server";
13 src = fetchFromGitHub {
15 repo = "language-tools";
16 rev = "@astrojs/language-server@${finalAttrs.version}";
17 hash = "sha256-2MaoW04mX016VIrtfnBX/jzMNCOXE10lSInSyhqot5E=";
20 pnpmDeps = pnpm.fetchDeps {
28 hash = "sha256-zCCDlwsKPZQVEYrv85WcMY2JlWgz0tD6iHLSJg1RkRU=";
36 buildInputs = [ nodejs_22 ];
38 # Must specify to download "@astrojs/yaml2ts" depencendies
39 # https://pnpm.io/filtering#--filter-package_name-1
40 pnpmWorkspace = "@astrojs/language-server...";
42 # Warning section for "pnpm@v8"
43 # https://pnpm.io/cli/install#--filter-package_selector
44 pnpm config set dedupe-peer-dependents false
50 # Must build the "@astrojs/yaml2ts" package. Dependency is linked via workspace by "pnpm"
51 # (https://github.com/withastro/language-tools/blob/%40astrojs/language-server%402.14.2/pnpm-lock.yaml#L78-L80)
52 pnpm --filter "@astrojs/language-server..." build
60 mkdir -p $out/{bin,lib/astro-language-server}
61 cp -r {packages,node_modules} $out/lib/astro-language-server
62 ln -s $out/lib/astro-language-server/packages/language-server/bin/nodeServer.js $out/bin/astro-ls
68 description = "The Astro language server";
69 homepage = "https://github.com/withastro/language-tools";
70 changelog = "https://github.com/withastro/language-tools/blob/@astrojs/language-server@${finalAttrs.version}/packages/language-server/CHANGELOG.md";
71 license = lib.licenses.mit;
72 maintainers = with lib.maintainers; [ pyrox0 ];
73 mainProgram = "astro-ls";
74 platforms = lib.platforms.unix;