Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stylelint-lsp: init at 2.0.0 #298407

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions pkgs/by-name/st/stylelint-lsp/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
bash,
fetchFromGitHub,
lib,
nodejs,
pnpm_9,
stdenvNoCC,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
pname = "stylelint-lsp";
version = "2.0.0";

src = fetchFromGitHub {
owner = "bmatcuk";
repo = "stylelint-lsp";
rev = "v${finalAttrs.version}";
hash = "sha256-mzhY6MKkXb1jFYZvs/VkGipBjBfUY3GukICb9qVQI80=";
};

nativeBuildInputs = [
nodejs
pnpm_9.configHook
];

pnpmDeps = pnpm_9.fetchDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-/QJ4buPOt5KFJxwsQp7L9WYE1RtODj4LMq21l99QwhA=";
};

buildPhase = ''
runHook preBuild

pnpm build

runHook postBuild
'';

installPhase = ''
runHook preInstall

mkdir -p $out/{bin,lib/${finalAttrs.pname}}
mv {dist,node_modules} $out/lib/${finalAttrs.pname}
echo "
#!${lib.getExe bash}
${lib.getExe nodejs} $out/lib/${finalAttrs.pname}/dist/index.js \$@
" > $out/bin/stylelint-lsp
chmod +x $out/bin/stylelint-lsp

runHook postInstall
'';

meta = with lib; {
description = "A stylelint Language Server";
homepage = "https://github.com/bmatcuk/stylelint-lsp";
license = licenses.mit;
maintainers = with maintainers; [ gepbird ];
mainProgram = "stylelint-lsp";
platforms = platforms.unix;
};
})