package: add prettier-plugin-astro

This commit is contained in:
Ching Pei Yang 2025-10-14 20:28:22 +02:00
commit db30023c78
No known key found for this signature in database
GPG key ID: B3841364253DC4C8
2 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{
stdenv,
fetchFromGitHub,
nodejs,
pnpm_9,
pins,
}: let
pin = pins.prettier-plugin-astro;
in
stdenv.mkDerivation (finalAttrs: {
pname = "prettier-plugin-astro";
version = pin.version or pin.revision;
src = fetchFromGitHub {
inherit (pin.repository) owner repo;
rev = finalAttrs.version;
sha256 = pin.hash;
};
pnpmDeps = pnpm_9.fetchDeps {
inherit (finalAttrs) pname src;
fetcherVersion = 2;
hash = "sha256-K7pIWLkIIbUKDIcysfEtcf/eVMX9ZgyFHdqcuycHCNE=";
};
nativeBuildInputs = [
nodejs
pnpm_9.configHook
];
buildPhase = ''
runHook preBuild
pnpm run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
# mkdir -p $out/dist
cp -r dist/ $out
cp -r node_modules $out
runHook postInstall
'';
})