forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / te / textlint-rule-write-good / package.nix
blobfeec3ced6ea9f665a4a37ff6a9f92710d6d84854
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchYarnDeps,
6   fixup-yarn-lock,
7   nodejs,
8   yarn,
9   textlint,
10   textlint-rule-write-good,
13 stdenv.mkDerivation (finalAttrs: {
14   pname = "textlint-rule-write-good";
15   version = "2.0.0-unstable-2024-05-02";
17   src = fetchFromGitHub {
18     owner = "textlint-rule";
19     repo = "textlint-rule-write-good";
20     rev = "586afa0989ae9ac8a93436f58a24d99afe1cac21";
21     hash = "sha256-ghEmWkwGVvLMy6Gf7IrariDRNfuNBc9EVOQz5w38g0I=";
22   };
24   offlineCache = fetchYarnDeps {
25     yarnLock = "${finalAttrs.src}/yarn.lock";
26     hash = "sha256-J02MoKPEYtehQMSaOR1Ytfme1ffgHbQcNnEENeTaxaA=";
27   };
29   nativeBuildInputs = [
30     fixup-yarn-lock
31     nodejs
32     yarn
33   ];
35   configurePhase = ''
36     runHook preConfigure
38     export HOME=$(mktemp -d)
39     yarn config --offline set yarn-offline-mirror "$offlineCache"
40     fixup-yarn-lock yarn.lock
41     yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
42     patchShebangs node_modules
44     runHook postConfigure
45   '';
47   buildPhase = ''
48     runHook preBuild
50     yarn --offline build
52     runHook postBuild
53   '';
55   installPhase = ''
56     runHook preInstall
58     yarn --offline --production install
59     rm -r test
60     mkdir -p $out/lib/node_modules/textlint-rule-write-good
61     cp -r . $out/lib/node_modules/textlint-rule-write-good/
63     runHook postInstall
64   '';
66   passthru.tests = textlint.testPackages {
67     rule = textlint-rule-write-good;
68     testFile = ./test.md;
69   };
71   meta = {
72     description = "Textlint rule to check your English styles with write-good";
73     homepage = "https://github.com/textlint-rule/textlint-rule-write-good";
74     changelog = "https://github.com/textlint-rule/textlint-rule-write-good/releases/tag/${finalAttrs.src.rev}";
75     license = lib.licenses.mit;
76     maintainers = with lib.maintainers; [ natsukium ];
77     platforms = textlint.meta.platforms;
78   };